Skip to content

Commit 36a4fcf

Browse files
committed
feat: update dashboard
1 parent c58c079 commit 36a4fcf

File tree

25 files changed

+975
-655
lines changed

25 files changed

+975
-655
lines changed

apps/web-antd/src/views/dashboard/workspace/index.vue

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@
22
import type {
33
WorkbenchProjectItem,
44
WorkbenchQuickNavItem,
5+
WorkbenchTodoItem,
6+
WorkbenchTrendItem,
57
} from '@vben/universal-ui';
68
9+
import { ref } from 'vue';
10+
711
import {
12+
AnalysisChartCard,
813
WorkbenchHeader,
914
WorkbenchProject,
1015
WorkbenchQuickNav,
16+
WorkbenchTodo,
17+
WorkbenchTrends,
1118
} from '@vben/universal-ui';
1219
import { preferences } from '@vben-core/preferences';
1320
1421
import { useAccessStore } from '#/store';
1522
23+
import AnalyticsVisitsSource from '../analytics/analytics-visits-source.vue';
24+
1625
defineOptions({ name: 'Workspace' });
1726
1827
const { userInfo } = useAccessStore();
@@ -100,6 +109,95 @@ const quickNavItems: WorkbenchQuickNavItem[] = [
100109
title: '图表',
101110
},
102111
];
112+
113+
const todoItems = ref<WorkbenchTodoItem[]>([
114+
{
115+
completed: false,
116+
content: `审查最近提交到Git仓库的前端代码,确保代码质量和规范。`,
117+
date: '2024-07-30 11:00:00',
118+
title: '审查前端代码提交',
119+
},
120+
{
121+
completed: true,
122+
content: `检查并优化系统性能,降低CPU使用率。`,
123+
date: '2024-07-30 11:00:00',
124+
title: '系统性能优化',
125+
},
126+
{
127+
completed: false,
128+
content: `进行系统安全检查,确保没有安全漏洞或未授权的访问。 `,
129+
date: '2024-07-30 11:00:00',
130+
title: '安全检查',
131+
},
132+
{
133+
completed: false,
134+
content: `更新项目中的所有npm依赖包,确保使用最新版本。`,
135+
date: '2024-07-30 11:00:00',
136+
title: '更新项目依赖',
137+
},
138+
{
139+
completed: false,
140+
content: `修复用户报告的页面UI显示问题,确保在不同浏览器中显示一致。 `,
141+
date: '2024-07-30 11:00:00',
142+
title: '修复UI显示问题',
143+
},
144+
]);
145+
const trendItems: WorkbenchTrendItem[] = [
146+
{
147+
avatar: 'svg:avatar-1',
148+
content: `在 <a>开源组</a> 创建了项目 <a>Vue</a>`,
149+
date: '刚刚',
150+
title: '威廉',
151+
},
152+
{
153+
avatar: 'svg:avatar-2',
154+
content: `关注了 <a>威廉</a> `,
155+
date: '1个小时前',
156+
title: '艾文',
157+
},
158+
{
159+
avatar: 'svg:avatar-3',
160+
content: `发布了 <a>个人动态</a> `,
161+
date: '1天前',
162+
title: '克里斯',
163+
},
164+
{
165+
avatar: 'svg:avatar-4',
166+
content: `发表文章 <a>如何编写一个Vite插件</a> `,
167+
date: '2天前',
168+
title: 'Vben',
169+
},
170+
{
171+
avatar: 'svg:avatar-1',
172+
content: `回复了 <a>杰克</a> 的问题 <a>如何进行项目优化?</a>`,
173+
date: '3天前',
174+
title: '皮特',
175+
},
176+
{
177+
avatar: 'svg:avatar-2',
178+
content: `关闭了问题 <a>如何运行项目</a> `,
179+
date: '1周前',
180+
title: '杰克',
181+
},
182+
{
183+
avatar: 'svg:avatar-3',
184+
content: `发布了 <a>个人动态</a> `,
185+
date: '1周前',
186+
title: '威廉',
187+
},
188+
{
189+
avatar: 'svg:avatar-4',
190+
content: `推送了代码到 <a>Github</a>`,
191+
date: '2021-04-01 20:00',
192+
title: '威廉',
193+
},
194+
{
195+
avatar: 'svg:avatar-4',
196+
content: `发表文章 <a>如何编写使用 Admin Vben</a> `,
197+
date: '2021-03-01 20:00',
198+
title: 'Vben',
199+
},
200+
];
103201
</script>
104202

105203
<template>
@@ -114,11 +212,16 @@ const quickNavItems: WorkbenchQuickNavItem[] = [
114212
</WorkbenchHeader>
115213

116214
<div class="mt-5 flex">
117-
<div class="mr-4 w-full md:w-2/3">
215+
<div class="mr-4 w-full md:w-3/5">
118216
<WorkbenchProject :items="projectItems" title="项目" />
217+
<WorkbenchTrends :items="trendItems" class="mt-5" title="最新动态" />
119218
</div>
120-
<div class="w-full md:w-1/3">
219+
<div class="w-full md:w-2/5">
121220
<WorkbenchQuickNav :items="quickNavItems" title="快捷导航" />
221+
<WorkbenchTodo :items="todoItems" class="mt-5" title="待办事项" />
222+
<AnalysisChartCard class="mt-5" title="访问来源">
223+
<AnalyticsVisitsSource />
224+
</AnalysisChartCard>
122225
</div>
123226
</div>
124227
</div>

apps/web-antd/vite.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from '@vben/vite-config';
33
export default defineConfig({
44
application: ({ mode }) => {
55
return {
6-
compress: false,
6+
compress: true,
77
compressTypes: ['brotli', 'gzip'],
88
importmap: false,
99
importmapOptions: {

internal/lint-configs/eslint-config/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"eslint-plugin-command": "^0.2.3"
3131
},
3232
"devDependencies": {
33-
"@eslint/js": "^9.5.0",
33+
"@eslint/js": "^9.6.0",
3434
"@types/eslint": "^8.56.10",
3535
"@typescript-eslint/eslint-plugin": "^7.14.1",
3636
"@typescript-eslint/parser": "^7.14.1",
@@ -49,7 +49,7 @@
4949
"eslint-plugin-unused-imports": "^4.0.0",
5050
"eslint-plugin-vitest": "^0.5.4",
5151
"eslint-plugin-vue": "^9.26.0",
52-
"globals": "^15.6.0",
52+
"globals": "^15.7.0",
5353
"jsonc-eslint-parser": "^2.4.0",
5454
"vue-eslint-parser": "^9.4.3"
5555
}

internal/lint-configs/stylelint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"stylelint-scss": "^6.3.2"
3434
},
3535
"devDependencies": {
36-
"postcss": "^8.4.38",
36+
"postcss": "^8.4.39",
3737
"postcss-html": "^1.7.0",
3838
"postcss-scss": "^4.0.9",
3939
"prettier": "^3.3.2",

internal/tailwind-config/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
"@tailwindcss/typography": "^0.5.13",
5353
"autoprefixer": "^10.4.19",
5454
"cssnano": "^7.0.3",
55-
"postcss": "^8.4.38",
55+
"postcss": "^8.4.39",
5656
"postcss-antd-fixes": "^0.2.0",
5757
"postcss-import": "^16.1.0",
58-
"postcss-preset-env": "^9.5.14",
58+
"postcss-preset-env": "^9.5.15",
5959
"tailwindcss": "^3.4.4",
6060
"tailwindcss-animate": "^1.0.7"
6161
},

internal/vite-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"resolve.exports": "^2.0.2",
3535
"vite-plugin-lib-inject-css": "^2.1.1",
3636
"vite-plugin-pwa": "^0.20.0",
37-
"vite-plugin-vue-devtools": "^7.3.4"
37+
"vite-plugin-vue-devtools": "^7.3.5"
3838
},
3939
"devDependencies": {
4040
"@types/html-minifier-terser": "^7.0.2",

internal/vite-config/src/config/library.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ function defineLibraryConfig(options: DefineLibraryOptions = {}) {
2828
const { dependencies = {}, peerDependencies = {} } =
2929
await readPackageJSON(root);
3030

31-
const external = [
31+
const externalPackages = [
3232
...Object.keys(dependencies),
3333
...Object.keys(peerDependencies),
3434
];
35+
3536
const packageConfig: UserConfig = {
3637
build: {
3738
lib: {
@@ -40,7 +41,11 @@ function defineLibraryConfig(options: DefineLibraryOptions = {}) {
4041
formats: ['es'],
4142
},
4243
rollupOptions: {
43-
external,
44+
external: (id) => {
45+
return externalPackages.some(
46+
(pkg) => id === pkg || id.startsWith(`${pkg}/`),
47+
);
48+
},
4449
},
4550
},
4651
plugins,

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@
6868
"is-ci": "^3.0.1",
6969
"jsdom": "^24.1.0",
7070
"rimraf": "^5.0.7",
71-
"taze": "^0.13.9",
72-
"turbo": "^2.0.5",
71+
"taze": "^0.14.0",
72+
"turbo": "^2.0.6",
7373
"typescript": "^5.5.2",
7474
"unbuild": "^2.0.0",
7575
"vite": "^5.3.2",
7676
"vitest": "^2.0.0-beta.10",
77-
"vue-tsc": "^2.0.22"
77+
"vue-tsc": "^2.0.24"
7878
},
7979
"engines": {
8080
"node": ">=20",

packages/@core/forward/preferences/src/preferences.ts

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ class PreferenceManager {
7777
this.updateTheme(this.state);
7878
}
7979

80-
if (appUpdates.colorGrayMode || appUpdates.colorWeakMode) {
80+
if (
81+
Reflect.has(appUpdates, 'colorGrayMode') ||
82+
Reflect.has(appUpdates, 'colorWeakMode')
83+
) {
8184
this.updateColorMode(this.state);
8285
}
8386
}
@@ -229,22 +232,16 @@ class PreferenceManager {
229232
return;
230233
}
231234

232-
const {
233-
builtinType,
234-
colorDestructive,
235-
colorPrimary,
236-
colorSuccess,
237-
colorWarning,
238-
mode,
239-
radius,
240-
} = preferences?.theme ?? {};
241-
242-
if (mode) {
235+
const theme = preferences?.theme ?? {};
236+
237+
const { builtinType, colorPrimary, mode, radius } = theme;
238+
239+
if (Reflect.has(theme, 'mode')) {
243240
const dark = isDarkTheme(mode);
244241
root.classList.toggle('dark', dark);
245242
}
246243

247-
if (builtinType) {
244+
if (Reflect.has(theme, 'builtinType')) {
248245
const rootTheme = root.dataset.theme;
249246
if (rootTheme !== builtinType) {
250247
root.dataset.theme = builtinType;
@@ -268,16 +265,16 @@ class PreferenceManager {
268265

269266
if (
270267
builtinTypeColorPrimary ||
271-
colorPrimary ||
272-
colorDestructive ||
273-
colorSuccess ||
274-
colorWarning
268+
Reflect.has(theme, 'colorPrimary') ||
269+
Reflect.has(theme, 'colorDestructive') ||
270+
Reflect.has(theme, 'colorSuccess') ||
271+
Reflect.has(theme, 'colorWarning')
275272
) {
276273
preferences.theme.colorPrimary = builtinTypeColorPrimary || colorPrimary;
277274
this.updateMainColors(preferences);
278275
}
279276

280-
if (radius) {
277+
if (Reflect.has(theme, 'radius')) {
281278
document.documentElement.style.setProperty('--radius', `${radius}rem`);
282279
}
283280
}

packages/business/chart-ui/src/echarts/echarts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ echarts.use([
5656
ToolboxComponent,
5757
]);
5858

59-
export { echarts };
59+
export default echarts;

0 commit comments

Comments
 (0)