From 8404c121295856b61ce89c0b2acb98bdd1601e1c Mon Sep 17 00:00:00 2001 From: Vben Date: Sat, 31 Aug 2024 21:38:24 +0800 Subject: [PATCH] refactor: refactor AuthLayout to configure the login page more freely (#4294) --- apps/web-antd/src/layouts/auth.vue | 23 +++++ apps/web-antd/src/layouts/index.ts | 4 +- .../dashboard/analytics/analytics-trends.vue | 20 +++- apps/web-ele/src/layouts/auth.vue | 23 +++++ apps/web-ele/src/layouts/index.ts | 4 +- .../dashboard/analytics/analytics-trends.vue | 20 +++- apps/web-naive/src/layouts/auth.vue | 23 +++++ apps/web-naive/src/layouts/index.ts | 4 +- .../dashboard/analytics/analytics-trends.vue | 20 +++- docs/src/en/guide/essentials/settings.md | 2 +- docs/src/en/guide/in-depth/login.md | 2 +- docs/src/en/guide/in-depth/theme.md | 6 +- docs/src/guide/essentials/settings.md | 2 +- docs/src/guide/in-depth/login.md | 31 +++---- docs/src/guide/in-depth/theme.md | 6 +- .../src/design-tokens/default/index.css | 3 +- packages/@core/preferences/src/config.ts | 2 +- packages/@core/preferences/src/constants.ts | 4 +- .../@core/ui-kit/popup-ui/src/modal/modal.vue | 4 +- .../input-password/input-password.vue | 4 +- .../src/components/spinner/loading.vue | 2 +- .../src/components/spinner/spinner.vue | 2 +- .../common-ui/src/ui/authentication/login.vue | 52 +++++++---- .../src/authentication/authentication.vue | 91 +++++++++++++------ .../layouts/src/authentication/form.vue | 16 +--- .../layouts/src/authentication/toolbar.vue | 7 +- .../layouts/src/authentication/types.ts | 1 + .../widgets/check-updates/check-updates.vue | 4 + playground/src/layouts/auth.vue | 23 +++++ playground/src/layouts/index.ts | 4 +- .../dashboard/analytics/analytics-trends.vue | 20 +++- 31 files changed, 314 insertions(+), 115 deletions(-) create mode 100644 apps/web-antd/src/layouts/auth.vue create mode 100644 apps/web-ele/src/layouts/auth.vue create mode 100644 apps/web-naive/src/layouts/auth.vue create mode 100644 packages/effects/layouts/src/authentication/types.ts create mode 100644 playground/src/layouts/auth.vue diff --git a/apps/web-antd/src/layouts/auth.vue b/apps/web-antd/src/layouts/auth.vue new file mode 100644 index 00000000..18d415bc --- /dev/null +++ b/apps/web-antd/src/layouts/auth.vue @@ -0,0 +1,23 @@ + + + diff --git a/apps/web-antd/src/layouts/index.ts b/apps/web-antd/src/layouts/index.ts index 23d79d6e..a4320780 100644 --- a/apps/web-antd/src/layouts/index.ts +++ b/apps/web-antd/src/layouts/index.ts @@ -1,8 +1,6 @@ const BasicLayout = () => import('./basic.vue'); +const AuthPageLayout = () => import('./auth.vue'); const IFrameView = () => import('@vben/layouts').then((m) => m.IFrameView); -const AuthPageLayout = () => - import('@vben/layouts').then((m) => m.AuthPageLayout); - export { AuthPageLayout, BasicLayout, IFrameView }; diff --git a/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue b/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue index 35e90276..fadfc917 100644 --- a/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue +++ b/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue @@ -55,12 +55,27 @@ onMounted(() => { }, trigger: 'axis', }, + // xAxis: { + // axisTick: { + // show: false, + // }, + // boundaryGap: false, + // data: Array.from({ length: 18 }).map((_item, index) => `${index + 6}:00`), + // type: 'category', + // }, xAxis: { axisTick: { show: false, }, boundaryGap: false, data: Array.from({ length: 18 }).map((_item, index) => `${index + 6}:00`), + splitLine: { + lineStyle: { + type: 'solid', + width: 1, + }, + show: true, + }, type: 'category', }, yAxis: [ @@ -69,7 +84,10 @@ onMounted(() => { show: false, }, max: 80_000, - + splitArea: { + show: true, + }, + splitNumber: 4, type: 'value', }, ], diff --git a/apps/web-ele/src/layouts/auth.vue b/apps/web-ele/src/layouts/auth.vue new file mode 100644 index 00000000..18d415bc --- /dev/null +++ b/apps/web-ele/src/layouts/auth.vue @@ -0,0 +1,23 @@ + + + diff --git a/apps/web-ele/src/layouts/index.ts b/apps/web-ele/src/layouts/index.ts index 23d79d6e..a4320780 100644 --- a/apps/web-ele/src/layouts/index.ts +++ b/apps/web-ele/src/layouts/index.ts @@ -1,8 +1,6 @@ const BasicLayout = () => import('./basic.vue'); +const AuthPageLayout = () => import('./auth.vue'); const IFrameView = () => import('@vben/layouts').then((m) => m.IFrameView); -const AuthPageLayout = () => - import('@vben/layouts').then((m) => m.AuthPageLayout); - export { AuthPageLayout, BasicLayout, IFrameView }; diff --git a/apps/web-ele/src/views/dashboard/analytics/analytics-trends.vue b/apps/web-ele/src/views/dashboard/analytics/analytics-trends.vue index 35e90276..fadfc917 100644 --- a/apps/web-ele/src/views/dashboard/analytics/analytics-trends.vue +++ b/apps/web-ele/src/views/dashboard/analytics/analytics-trends.vue @@ -55,12 +55,27 @@ onMounted(() => { }, trigger: 'axis', }, + // xAxis: { + // axisTick: { + // show: false, + // }, + // boundaryGap: false, + // data: Array.from({ length: 18 }).map((_item, index) => `${index + 6}:00`), + // type: 'category', + // }, xAxis: { axisTick: { show: false, }, boundaryGap: false, data: Array.from({ length: 18 }).map((_item, index) => `${index + 6}:00`), + splitLine: { + lineStyle: { + type: 'solid', + width: 1, + }, + show: true, + }, type: 'category', }, yAxis: [ @@ -69,7 +84,10 @@ onMounted(() => { show: false, }, max: 80_000, - + splitArea: { + show: true, + }, + splitNumber: 4, type: 'value', }, ], diff --git a/apps/web-naive/src/layouts/auth.vue b/apps/web-naive/src/layouts/auth.vue new file mode 100644 index 00000000..18d415bc --- /dev/null +++ b/apps/web-naive/src/layouts/auth.vue @@ -0,0 +1,23 @@ + + + diff --git a/apps/web-naive/src/layouts/index.ts b/apps/web-naive/src/layouts/index.ts index 23d79d6e..a4320780 100644 --- a/apps/web-naive/src/layouts/index.ts +++ b/apps/web-naive/src/layouts/index.ts @@ -1,8 +1,6 @@ const BasicLayout = () => import('./basic.vue'); +const AuthPageLayout = () => import('./auth.vue'); const IFrameView = () => import('@vben/layouts').then((m) => m.IFrameView); -const AuthPageLayout = () => - import('@vben/layouts').then((m) => m.AuthPageLayout); - export { AuthPageLayout, BasicLayout, IFrameView }; diff --git a/apps/web-naive/src/views/dashboard/analytics/analytics-trends.vue b/apps/web-naive/src/views/dashboard/analytics/analytics-trends.vue index 35e90276..fadfc917 100644 --- a/apps/web-naive/src/views/dashboard/analytics/analytics-trends.vue +++ b/apps/web-naive/src/views/dashboard/analytics/analytics-trends.vue @@ -55,12 +55,27 @@ onMounted(() => { }, trigger: 'axis', }, + // xAxis: { + // axisTick: { + // show: false, + // }, + // boundaryGap: false, + // data: Array.from({ length: 18 }).map((_item, index) => `${index + 6}:00`), + // type: 'category', + // }, xAxis: { axisTick: { show: false, }, boundaryGap: false, data: Array.from({ length: 18 }).map((_item, index) => `${index + 6}:00`), + splitLine: { + lineStyle: { + type: 'solid', + width: 1, + }, + show: true, + }, type: 'category', }, yAxis: [ @@ -69,7 +84,10 @@ onMounted(() => { show: false, }, max: 80_000, - + splitArea: { + show: true, + }, + splitNumber: 4, type: 'value', }, ], diff --git a/docs/src/en/guide/essentials/settings.md b/docs/src/en/guide/essentials/settings.md index 7fc2c399..5a9eb5c4 100644 --- a/docs/src/en/guide/essentials/settings.md +++ b/docs/src/en/guide/essentials/settings.md @@ -240,7 +240,7 @@ const defaultPreferences: Preferences = { theme: { builtinType: 'default', colorDestructive: 'hsl(348 100% 61%)', - colorPrimary: 'hsl(231 98% 65%)', + colorPrimary: 'hsl(212 100% 45%)', colorSuccess: 'hsl(144 57% 58%)', colorWarning: 'hsl(42 84% 61%)', mode: 'dark', diff --git a/docs/src/en/guide/in-depth/login.md b/docs/src/en/guide/in-depth/login.md index 207e9497..ac57a320 100644 --- a/docs/src/en/guide/in-depth/login.md +++ b/docs/src/en/guide/in-depth/login.md @@ -18,7 +18,7 @@ You just need to configure the `props` parameter of `AuthPageLayout` in `src/rou pageTitle: "开箱即用的大型中后台管理系统", pageDescription: "工程化、高性能、跨组件库的前端模版", toolbar: true, - toolbarList: () => ['color', 'language', 'layout', 'theme'], + toolbarList: ['color', 'language', 'layout', 'theme'], } // ... }, diff --git a/docs/src/en/guide/in-depth/theme.md b/docs/src/en/guide/in-depth/theme.md index 95a9e478..11c9c992 100644 --- a/docs/src/en/guide/in-depth/theme.md +++ b/docs/src/en/guide/in-depth/theme.md @@ -53,7 +53,7 @@ You can check the list below to understand all the available variables. /* Theme Colors */ - --primary: 231 98% 65%; + --primary: 212 100% 45%; --primary-foreground: 0 0% 98%; /* Used for destructive actions such as