openxiangda 1.0.39 → 1.0.41
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 +2 -2
- package/lib/cli.js +9 -1
- package/openxiangda-skills/SKILL.md +6 -3
- package/openxiangda-skills/references/best-practices.md +29 -5
- package/openxiangda-skills/references/component-guide.md +79 -45
- package/openxiangda-skills/references/forms/component-registry.md +33 -1
- package/openxiangda-skills/references/openxiangda-api.md +7 -0
- package/openxiangda-skills/references/permissions-settings.md +27 -4
- package/openxiangda-skills/skills/openxiangda-core/SKILL.md +2 -2
- package/openxiangda-skills/skills/openxiangda-form/SKILL.md +9 -2
- package/openxiangda-skills/skills/openxiangda-page/SKILL.md +5 -3
- package/openxiangda-skills/skills/openxiangda-permission-settings/SKILL.md +5 -0
- package/package.json +1 -1
- package/packages/sdk/dist/runtime/index.cjs +546 -0
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +13 -1
- package/packages/sdk/dist/runtime/index.d.ts +13 -1
- package/packages/sdk/dist/runtime/index.mjs +546 -0
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/src/build-source/scripts/build-forms.mjs +5 -1
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-form.mdc +4 -0
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-page.mdc +2 -0
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda.mdc +3 -0
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-form.md +4 -0
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-page.md +2 -0
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda.md +3 -0
- package/templates/sy-lowcode-app-workspace/AGENTS.md +5 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/README.md +8 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/catalog.json +32 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/decision-guide.md +20 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/design-style.md +48 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/App.tsx +8 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/GlassHomeDashboard.tsx +232 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/index.tsx +10 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/page.config.ts +14 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/styles.css +196 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/App.tsx +8 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/MintAnalyticsDashboard.tsx +279 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/index.tsx +10 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/page.config.ts +14 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/styles.css +163 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/App.tsx +8 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/OpsMonitorDashboard.tsx +306 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/index.tsx +10 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/page.config.ts +14 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/styles.css +248 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/App.tsx +8 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/WorkOrderListDrawerPage.tsx +371 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/index.tsx +10 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/page.config.ts +14 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/styles.css +182 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/DashboardPrimitives.tsx +832 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/chartOptions.ts +140 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/sampleData.ts +466 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/styles.css +874 -0
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/types.ts +150 -0
- package/templates/sy-lowcode-app-workspace/src/forms/README.md +4 -0
- package/templates/sy-lowcode-app-workspace/src/main.tsx +4 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
.bp-glass-state-panel {
|
|
2
|
+
min-height: 420px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.bp-glass-hero-grid {
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.85fr);
|
|
8
|
+
gap: 18px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.bp-glass-hero {
|
|
12
|
+
position: relative;
|
|
13
|
+
min-height: 212px;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
background:
|
|
16
|
+
linear-gradient(110deg, rgba(255, 255, 255, 0.92) 0%, rgba(235, 246, 255, 0.68) 54%, rgba(219, 234, 254, 0.84) 100%),
|
|
17
|
+
radial-gradient(circle at 78% 16%, rgba(96, 165, 250, 0.28), transparent 36%);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bp-glass-hero__copy {
|
|
21
|
+
position: relative;
|
|
22
|
+
z-index: 1;
|
|
23
|
+
width: min(520px, 100%);
|
|
24
|
+
padding: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.bp-glass-hero h1 {
|
|
28
|
+
margin: 0 0 12px;
|
|
29
|
+
color: #0f172a;
|
|
30
|
+
font-size: 27px;
|
|
31
|
+
font-weight: 800;
|
|
32
|
+
letter-spacing: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.bp-glass-hero p {
|
|
36
|
+
margin: 0;
|
|
37
|
+
color: #475569;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bp-glass-hero__pills {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-wrap: wrap;
|
|
44
|
+
gap: 10px;
|
|
45
|
+
margin-top: 34px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.bp-glass-hero__visual {
|
|
49
|
+
position: absolute;
|
|
50
|
+
inset: 20px 18px 0 auto;
|
|
51
|
+
width: 300px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bp-glass-hero__visual .card {
|
|
55
|
+
position: absolute;
|
|
56
|
+
display: block;
|
|
57
|
+
border: 1px solid rgba(147, 197, 253, 0.75);
|
|
58
|
+
border-radius: 18px;
|
|
59
|
+
background: linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(56, 189, 248, 0.22));
|
|
60
|
+
box-shadow: 0 24px 48px rgba(59, 130, 246, 0.22);
|
|
61
|
+
transform: skewY(9deg);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.bp-glass-hero__visual .card-a {
|
|
65
|
+
right: 24px;
|
|
66
|
+
top: 0;
|
|
67
|
+
width: 130px;
|
|
68
|
+
height: 150px;
|
|
69
|
+
background: linear-gradient(145deg, rgba(125, 211, 252, 0.76), rgba(37, 99, 235, 0.32));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.bp-glass-hero__visual .card-b {
|
|
73
|
+
right: 104px;
|
|
74
|
+
top: 58px;
|
|
75
|
+
width: 118px;
|
|
76
|
+
height: 128px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.bp-glass-hero__visual .card-c {
|
|
80
|
+
right: 184px;
|
|
81
|
+
top: 108px;
|
|
82
|
+
width: 94px;
|
|
83
|
+
height: 98px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.bp-glass-hero__visual .wave {
|
|
87
|
+
position: absolute;
|
|
88
|
+
right: 44px;
|
|
89
|
+
top: 120px;
|
|
90
|
+
width: 180px;
|
|
91
|
+
height: 46px;
|
|
92
|
+
border: solid rgba(255, 255, 255, 0.82);
|
|
93
|
+
border-width: 0 0 4px;
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
transform: rotate(-8deg);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.bp-glass-metrics {
|
|
99
|
+
display: grid;
|
|
100
|
+
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
101
|
+
gap: 18px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bp-glass-main-grid {
|
|
105
|
+
display: grid;
|
|
106
|
+
grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr);
|
|
107
|
+
gap: 18px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.bp-glass-chart-panel {
|
|
111
|
+
min-height: 344px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.bp-glass-chart-split {
|
|
115
|
+
display: grid;
|
|
116
|
+
grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
|
|
117
|
+
gap: 16px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.bp-glass-side-stack {
|
|
121
|
+
display: grid;
|
|
122
|
+
gap: 18px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.bp-glass-bottom-grid {
|
|
126
|
+
display: grid;
|
|
127
|
+
grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr);
|
|
128
|
+
gap: 18px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.bp-glass-targets {
|
|
132
|
+
display: grid;
|
|
133
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
134
|
+
gap: 12px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.bp-glass-targets > div {
|
|
138
|
+
display: grid;
|
|
139
|
+
gap: 10px;
|
|
140
|
+
min-width: 0;
|
|
141
|
+
padding: 14px;
|
|
142
|
+
border: 1px solid rgba(226, 232, 240, 0.9);
|
|
143
|
+
border-radius: 12px;
|
|
144
|
+
background: rgba(255, 255, 255, 0.74);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.bp-glass-targets span {
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
color: #334155;
|
|
150
|
+
font-size: 13px;
|
|
151
|
+
text-overflow: ellipsis;
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.bp-glass-targets strong {
|
|
156
|
+
color: #0f172a;
|
|
157
|
+
font-size: 16px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.bp-glass-targets div div {
|
|
161
|
+
height: 7px;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
border-radius: 999px;
|
|
164
|
+
background: #e2e8f0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.bp-glass-targets i {
|
|
168
|
+
display: block;
|
|
169
|
+
height: 100%;
|
|
170
|
+
border-radius: inherit;
|
|
171
|
+
background: linear-gradient(90deg, #3b82f6, #8b5cf6);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@media (max-width: 1280px) {
|
|
175
|
+
.bp-glass-hero-grid,
|
|
176
|
+
.bp-glass-main-grid,
|
|
177
|
+
.bp-glass-bottom-grid {
|
|
178
|
+
grid-template-columns: 1fr;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.bp-glass-metrics {
|
|
182
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@media (max-width: 920px) {
|
|
187
|
+
.bp-glass-metrics,
|
|
188
|
+
.bp-glass-chart-split,
|
|
189
|
+
.bp-glass-targets {
|
|
190
|
+
grid-template-columns: 1fr;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.bp-glass-hero__visual {
|
|
194
|
+
display: none;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { App as AntdApp, Button, DatePicker, Select, Space, Tag } from "antd";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
|
|
4
|
+
import { QueryState } from "@/shared/components/QueryState";
|
|
5
|
+
import {
|
|
6
|
+
AdminShell,
|
|
7
|
+
AdminTopbar,
|
|
8
|
+
DashboardChart,
|
|
9
|
+
HealthScore,
|
|
10
|
+
MetricCard,
|
|
11
|
+
NoticeList,
|
|
12
|
+
Panel,
|
|
13
|
+
QuickActionGrid,
|
|
14
|
+
TemplateActionDrawer,
|
|
15
|
+
TodoList,
|
|
16
|
+
} from "@/shared/components/admin-ui-templates/DashboardPrimitives";
|
|
17
|
+
import {
|
|
18
|
+
createBarCompareOption,
|
|
19
|
+
createDonutOption,
|
|
20
|
+
createLineAreaOption,
|
|
21
|
+
} from "@/shared/components/admin-ui-templates/chartOptions";
|
|
22
|
+
import {
|
|
23
|
+
mintMetrics,
|
|
24
|
+
notices,
|
|
25
|
+
quickActions,
|
|
26
|
+
standardNavItems,
|
|
27
|
+
todos,
|
|
28
|
+
} from "@/shared/components/admin-ui-templates/sampleData";
|
|
29
|
+
import type {
|
|
30
|
+
DrawerMode,
|
|
31
|
+
QuickAction,
|
|
32
|
+
} from "@/shared/components/admin-ui-templates/types";
|
|
33
|
+
|
|
34
|
+
type ViewState = "ready" | "loading" | "empty" | "error";
|
|
35
|
+
type CompareMode = "day" | "week" | "month";
|
|
36
|
+
|
|
37
|
+
const labels = ["03-04", "03-05", "03-06", "03-07", "03-08", "03-09", "03-10"];
|
|
38
|
+
|
|
39
|
+
export function MintAnalyticsDashboard() {
|
|
40
|
+
const { message } = AntdApp.useApp();
|
|
41
|
+
const [activeNav, setActiveNav] = useState("home");
|
|
42
|
+
const [compareMode, setCompareMode] = useState<CompareMode>("day");
|
|
43
|
+
const [viewState, setViewState] = useState<ViewState>("ready");
|
|
44
|
+
const [drawerAction, setDrawerAction] = useState<QuickAction | null>(null);
|
|
45
|
+
const [drawerMode, setDrawerMode] = useState<DrawerMode>("create");
|
|
46
|
+
|
|
47
|
+
const revenueOption = useMemo(
|
|
48
|
+
() =>
|
|
49
|
+
createLineAreaOption({
|
|
50
|
+
colors: ["#10b981", "#3b82f6"],
|
|
51
|
+
labels,
|
|
52
|
+
primaryName: "营业收入",
|
|
53
|
+
secondaryName: "订单金额",
|
|
54
|
+
primary: [520, 570, 760, 840, 1082, 650, 1160],
|
|
55
|
+
secondary: [380, 430, 520, 580, 710, 480, 690],
|
|
56
|
+
}),
|
|
57
|
+
[],
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const compareOption = useMemo(
|
|
61
|
+
() =>
|
|
62
|
+
createBarCompareOption({
|
|
63
|
+
labels,
|
|
64
|
+
series: [
|
|
65
|
+
{
|
|
66
|
+
name: compareMode === "day" ? "营业收入" : "本期收入",
|
|
67
|
+
data: [1120, 1210, 980, 1130, 1280, 900, 1100],
|
|
68
|
+
color: "#3b82f6",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "订单金额",
|
|
72
|
+
data: [940, 810, 730, 820, 1080, 620, 760],
|
|
73
|
+
color: "#10b981",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "支付金额",
|
|
77
|
+
data: [650, 590, 510, 610, 760, 430, 540],
|
|
78
|
+
color: "#f59e0b",
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
}),
|
|
82
|
+
[compareMode],
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const channelOption = useMemo(
|
|
86
|
+
() =>
|
|
87
|
+
createDonutOption({
|
|
88
|
+
centerLabel: "总订单数",
|
|
89
|
+
centerValue: "12,568",
|
|
90
|
+
data: [
|
|
91
|
+
{ name: "线上商城 38.6%", value: 38.6, color: "#10b981" },
|
|
92
|
+
{ name: "移动端 APP 28.7%", value: 28.7, color: "#3b82f6" },
|
|
93
|
+
{ name: "小程序 17.3%", value: 17.3, color: "#f59e0b" },
|
|
94
|
+
{ name: "第三方平台 10.5%", value: 10.5, color: "#fbbf24" },
|
|
95
|
+
{ name: "线下门店 4.9%", value: 4.9, color: "#cbd5e1" },
|
|
96
|
+
],
|
|
97
|
+
}),
|
|
98
|
+
[],
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
function refresh() {
|
|
102
|
+
setViewState("loading");
|
|
103
|
+
window.setTimeout(() => {
|
|
104
|
+
setViewState("ready");
|
|
105
|
+
message.success("分析数据已更新");
|
|
106
|
+
}, 500);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function openActionDrawer(action: QuickAction, mode: DrawerMode = "create") {
|
|
110
|
+
setDrawerAction(action);
|
|
111
|
+
setDrawerMode(mode);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<AdminShell
|
|
116
|
+
variant="mint"
|
|
117
|
+
activeKey={activeNav}
|
|
118
|
+
navItems={standardNavItems}
|
|
119
|
+
brandTitle="未来数智运营平台"
|
|
120
|
+
brandSubtitle="企业级数据决策中台"
|
|
121
|
+
topbar={
|
|
122
|
+
<AdminTopbar
|
|
123
|
+
title="首页总览"
|
|
124
|
+
subtitle="全面掌握业务动态,数据驱动智能决策"
|
|
125
|
+
searchPlaceholder="搜索菜单、功能、报表"
|
|
126
|
+
userName="管理员"
|
|
127
|
+
extra={
|
|
128
|
+
<Space size={8}>
|
|
129
|
+
<Tag className="bp-mint-time">数据更新时间:2026-03-10 23:40:00</Tag>
|
|
130
|
+
<Button onClick={refresh}>刷新</Button>
|
|
131
|
+
<Select<ViewState>
|
|
132
|
+
size="small"
|
|
133
|
+
value={viewState}
|
|
134
|
+
onChange={setViewState}
|
|
135
|
+
options={[
|
|
136
|
+
{ value: "ready", label: "正常" },
|
|
137
|
+
{ value: "loading", label: "加载" },
|
|
138
|
+
{ value: "empty", label: "空态" },
|
|
139
|
+
{ value: "error", label: "错误" },
|
|
140
|
+
]}
|
|
141
|
+
/>
|
|
142
|
+
</Space>
|
|
143
|
+
}
|
|
144
|
+
/>
|
|
145
|
+
}
|
|
146
|
+
sidebarFooter={
|
|
147
|
+
<>
|
|
148
|
+
<div className="bp-mint-shortcuts">
|
|
149
|
+
<strong>快捷入口</strong>
|
|
150
|
+
<span>数据报表</span>
|
|
151
|
+
<span>自定义看板</span>
|
|
152
|
+
<span>数据导出</span>
|
|
153
|
+
<span>帮助中心</span>
|
|
154
|
+
</div>
|
|
155
|
+
</>
|
|
156
|
+
}
|
|
157
|
+
onNavChange={setActiveNav}
|
|
158
|
+
>
|
|
159
|
+
{viewState !== "ready" ? (
|
|
160
|
+
<Panel className="bp-mint-state-panel">
|
|
161
|
+
<QueryState
|
|
162
|
+
loading={viewState === "loading"}
|
|
163
|
+
empty={viewState === "empty"}
|
|
164
|
+
error={viewState === "error" ? "模拟分析接口异常,请点击重试恢复。" : null}
|
|
165
|
+
onRetry={() => setViewState("ready")}
|
|
166
|
+
/>
|
|
167
|
+
</Panel>
|
|
168
|
+
) : (
|
|
169
|
+
<>
|
|
170
|
+
<section className="bp-mint-intro">
|
|
171
|
+
<div>
|
|
172
|
+
<h1>
|
|
173
|
+
晚上好,超级管理员 <Tag color="green">管理员</Tag>
|
|
174
|
+
</h1>
|
|
175
|
+
<p>本周核心指标 03.04 - 03.10</p>
|
|
176
|
+
</div>
|
|
177
|
+
<DatePicker />
|
|
178
|
+
</section>
|
|
179
|
+
|
|
180
|
+
<section className="bp-mint-metrics">
|
|
181
|
+
{mintMetrics.map((metric) => (
|
|
182
|
+
<MetricCard key={metric.id} metric={metric} />
|
|
183
|
+
))}
|
|
184
|
+
</section>
|
|
185
|
+
|
|
186
|
+
<section className="bp-mint-grid">
|
|
187
|
+
<Panel title="营业收入趋势" className="bp-mint-large-panel">
|
|
188
|
+
<DashboardChart option={revenueOption} height={260} />
|
|
189
|
+
</Panel>
|
|
190
|
+
<Panel
|
|
191
|
+
title="业务对比分析"
|
|
192
|
+
className="bp-mint-large-panel"
|
|
193
|
+
extra={
|
|
194
|
+
<Space size={4}>
|
|
195
|
+
{(["day", "week", "month"] as CompareMode[]).map((mode) => (
|
|
196
|
+
<Button
|
|
197
|
+
key={mode}
|
|
198
|
+
size="small"
|
|
199
|
+
type={compareMode === mode ? "primary" : "text"}
|
|
200
|
+
onClick={() => setCompareMode(mode)}
|
|
201
|
+
>
|
|
202
|
+
{mode === "day" ? "按日" : mode === "week" ? "按周" : "按月"}
|
|
203
|
+
</Button>
|
|
204
|
+
))}
|
|
205
|
+
</Space>
|
|
206
|
+
}
|
|
207
|
+
>
|
|
208
|
+
<DashboardChart option={compareOption} height={260} />
|
|
209
|
+
</Panel>
|
|
210
|
+
<Panel title="平台通知">
|
|
211
|
+
<NoticeList items={notices} />
|
|
212
|
+
</Panel>
|
|
213
|
+
<Panel title="用户增长趋势" className="bp-mint-large-panel">
|
|
214
|
+
<DashboardChart
|
|
215
|
+
height={245}
|
|
216
|
+
option={createLineAreaOption({
|
|
217
|
+
colors: ["#10b981", "#3b82f6"],
|
|
218
|
+
labels,
|
|
219
|
+
primaryName: "新增用户",
|
|
220
|
+
secondaryName: "活跃用户",
|
|
221
|
+
primary: [580, 820, 860, 1050, 980, 960, 1500],
|
|
222
|
+
secondary: [900, 1320, 1350, 2140, 1780, 1700, 2400],
|
|
223
|
+
})}
|
|
224
|
+
/>
|
|
225
|
+
</Panel>
|
|
226
|
+
<Panel title="渠道资源分布">
|
|
227
|
+
<DashboardChart option={channelOption} height={245} />
|
|
228
|
+
</Panel>
|
|
229
|
+
<Panel title="待办事项">
|
|
230
|
+
<TodoList items={todos} />
|
|
231
|
+
</Panel>
|
|
232
|
+
</section>
|
|
233
|
+
|
|
234
|
+
<section className="bp-mint-bottom">
|
|
235
|
+
<Panel title="快捷操作">
|
|
236
|
+
<QuickActionGrid
|
|
237
|
+
actions={quickActions.slice(0, 5)}
|
|
238
|
+
compact
|
|
239
|
+
onAction={(action) => openActionDrawer(action)}
|
|
240
|
+
/>
|
|
241
|
+
</Panel>
|
|
242
|
+
<Panel title="业务概览">
|
|
243
|
+
<div className="bp-mint-business-summary">
|
|
244
|
+
{[
|
|
245
|
+
["商品总数", "2,350", "5.2%"],
|
|
246
|
+
["库存预警", "32", "11.1%"],
|
|
247
|
+
["在售商品", "1,986", "3.8%"],
|
|
248
|
+
["库存周转率", "4.62", "6.3%"],
|
|
249
|
+
].map(([label, value, delta], index) => (
|
|
250
|
+
<div key={label}>
|
|
251
|
+
<span>{label}</span>
|
|
252
|
+
<strong>{value}</strong>
|
|
253
|
+
<small className={index === 1 ? "is-down" : ""}>
|
|
254
|
+
较上周 {index === 1 ? "↓" : "↑"} {delta}
|
|
255
|
+
</small>
|
|
256
|
+
</div>
|
|
257
|
+
))}
|
|
258
|
+
</div>
|
|
259
|
+
</Panel>
|
|
260
|
+
<Panel title="系统健康度">
|
|
261
|
+
<HealthScore value={98} tone="mint" />
|
|
262
|
+
</Panel>
|
|
263
|
+
</section>
|
|
264
|
+
</>
|
|
265
|
+
)}
|
|
266
|
+
|
|
267
|
+
<TemplateActionDrawer
|
|
268
|
+
open={Boolean(drawerAction)}
|
|
269
|
+
title={drawerAction ? `${drawerAction.label}` : "新建事项"}
|
|
270
|
+
mode={drawerMode}
|
|
271
|
+
onClose={() => setDrawerAction(null)}
|
|
272
|
+
onSubmit={() => {
|
|
273
|
+
setDrawerAction(null);
|
|
274
|
+
message.success("表单已保存");
|
|
275
|
+
}}
|
|
276
|
+
/>
|
|
277
|
+
</AdminShell>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { definePageConfig } from "@/types/app-workspace.types";
|
|
2
|
+
|
|
3
|
+
export default definePageConfig({
|
|
4
|
+
code: "mint_analytics_dashboard",
|
|
5
|
+
name: "薄荷数据分析首页",
|
|
6
|
+
description: "后台管理薄荷绿色数据分析首页模板",
|
|
7
|
+
route: { pathKey: "mint_analytics_dashboard" },
|
|
8
|
+
entry: {
|
|
9
|
+
mode: "app-shell",
|
|
10
|
+
hidePlatformNav: true,
|
|
11
|
+
defaultRoute: "home",
|
|
12
|
+
},
|
|
13
|
+
menu: { name: "薄荷数据分析首页" },
|
|
14
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
.bp-mint-time {
|
|
2
|
+
max-width: 260px;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
border: 1px solid rgba(16, 185, 129, 0.15);
|
|
5
|
+
border-radius: 999px;
|
|
6
|
+
color: #475569;
|
|
7
|
+
text-overflow: ellipsis;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.bp-mint-state-panel {
|
|
12
|
+
min-height: 440px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.bp-mint-shortcuts {
|
|
16
|
+
display: grid;
|
|
17
|
+
gap: 10px;
|
|
18
|
+
margin-bottom: 16px;
|
|
19
|
+
padding: 16px;
|
|
20
|
+
border: 1px solid rgba(16, 185, 129, 0.16);
|
|
21
|
+
border-radius: 16px;
|
|
22
|
+
background: rgba(255, 255, 255, 0.62);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.bp-mint-shortcuts strong {
|
|
26
|
+
color: #0f172a;
|
|
27
|
+
font-size: 13px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.bp-mint-shortcuts span {
|
|
31
|
+
color: #475569;
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.bp-mint-intro {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
gap: 16px;
|
|
40
|
+
padding: 10px 8px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.bp-mint-intro h1 {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
align-items: center;
|
|
48
|
+
margin: 0 0 6px;
|
|
49
|
+
color: #0f172a;
|
|
50
|
+
font-size: 22px;
|
|
51
|
+
font-weight: 800;
|
|
52
|
+
letter-spacing: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.bp-mint-intro p {
|
|
56
|
+
margin: 0;
|
|
57
|
+
color: #64748b;
|
|
58
|
+
font-size: 13px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.bp-mint-metrics {
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
64
|
+
gap: 14px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.bp-mint-metrics .bp-admin-metric {
|
|
68
|
+
min-height: 132px;
|
|
69
|
+
border-radius: 12px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.bp-mint-grid {
|
|
73
|
+
display: grid;
|
|
74
|
+
grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(300px, 0.8fr);
|
|
75
|
+
gap: 16px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.bp-mint-large-panel {
|
|
79
|
+
min-height: 324px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.bp-mint-bottom {
|
|
83
|
+
display: grid;
|
|
84
|
+
grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr) minmax(300px, 0.85fr);
|
|
85
|
+
gap: 16px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.bp-mint-business-summary {
|
|
89
|
+
display: grid;
|
|
90
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
91
|
+
gap: 12px;
|
|
92
|
+
padding: 6px 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.bp-mint-business-summary div {
|
|
96
|
+
min-width: 0;
|
|
97
|
+
padding: 8px 12px;
|
|
98
|
+
border-right: 1px solid #e5eaf2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.bp-mint-business-summary div:last-child {
|
|
102
|
+
border-right: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.bp-mint-business-summary span,
|
|
106
|
+
.bp-mint-business-summary small {
|
|
107
|
+
display: block;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.bp-mint-business-summary span {
|
|
114
|
+
color: #64748b;
|
|
115
|
+
font-size: 13px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.bp-mint-business-summary strong {
|
|
119
|
+
display: block;
|
|
120
|
+
margin: 9px 0;
|
|
121
|
+
color: #0f172a;
|
|
122
|
+
font-size: 22px;
|
|
123
|
+
line-height: 1;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.bp-mint-business-summary small {
|
|
127
|
+
color: #10b981;
|
|
128
|
+
font-size: 12px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.bp-mint-business-summary .is-down {
|
|
132
|
+
color: #ef4444;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (max-width: 1380px) {
|
|
136
|
+
.bp-mint-metrics {
|
|
137
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.bp-mint-grid,
|
|
141
|
+
.bp-mint-bottom {
|
|
142
|
+
grid-template-columns: 1fr 1fr;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@media (max-width: 920px) {
|
|
147
|
+
.bp-mint-intro {
|
|
148
|
+
align-items: stretch;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.bp-mint-metrics,
|
|
153
|
+
.bp-mint-grid,
|
|
154
|
+
.bp-mint-bottom,
|
|
155
|
+
.bp-mint-business-summary {
|
|
156
|
+
grid-template-columns: 1fr;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.bp-mint-business-summary div {
|
|
160
|
+
border-right: 0;
|
|
161
|
+
border-bottom: 1px solid #e5eaf2;
|
|
162
|
+
}
|
|
163
|
+
}
|