From e8a78fa8b6df9bfee5c8f78979c86598d5690361 Mon Sep 17 00:00:00 2001 From: Leo <98382335+gaoziman@users.noreply.github.com> Date: Wed, 8 Oct 2025 02:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=EF=BC=9A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B8=83=E5=B1=80=E3=80=81=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=92=8C=E4=BB=AA=E8=A1=A8=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加页面布局组件(src/layouts/) - 主布局容器 - 头部导航栏 - 侧边菜单栏 - 标签页栏 - 页脚组件 - 添加登录模块(src/views/login/) - 登录表单 - 验证码组件 - 登录背景动画 - 添加错误页面(src/views/error/) - 404页面 - 500页面 - 添加仪表盘页面(src/views/dashboard/) - 数据概览 - 图表展示 - 添加静态资源(src/assets/) - 添加全局样式(src/styles/) - 添加Vue模块配置(src/modules/) --- src/assets/svg-icons/cool.svg | 1 + src/assets/svg-icons/logo.svg | 1 + src/assets/svg/error-403.svg | 1 + src/assets/svg/error-404.svg | 1 + src/assets/svg/error-500.svg | 1 + src/layouts/components/common/BackTop.vue | 15 + .../components/common/LayoutSelector.vue | 72 ++ src/layouts/components/common/NoticeList.vue | 45 + src/layouts/components/common/Setting.vue | 18 + .../components/common/SettingDrawer.vue | 148 +++ src/layouts/components/header/Breadcrumb.vue | 50 + .../components/header/CollapaseButton.vue | 19 + src/layouts/components/header/FullScreen.vue | 27 + src/layouts/components/header/Notices.vue | 144 +++ src/layouts/components/header/Search.vue | 217 +++++ src/layouts/components/index.ts | 26 + src/layouts/components/sider/Logo.vue | 83 ++ src/layouts/components/sider/Menu.vue | 29 + .../components/tab/ContentFullScreen.vue | 17 + src/layouts/components/tab/DropTabs.vue | 41 + src/layouts/components/tab/Reload.vue | 28 + src/layouts/components/tab/TabBar.vue | 147 +++ src/layouts/components/tab/TabBarItem.vue | 41 + src/layouts/index.vue | 19 + src/layouts/leftMenu.layout.vue | 99 ++ src/layouts/mixMenu.layout.vue | 157 +++ src/layouts/topMenu.layout.vue | 64 ++ src/modules/assets.ts | 6 + src/modules/directives.ts | 10 + src/modules/i18n.ts | 26 + src/styles/index.css | 20 + src/styles/naive.css | 14 + src/styles/reset.css | 403 ++++++++ src/styles/transition.css | 92 ++ .../components/DashboardStatCard.vue | 283 ++++++ .../dashboard/components/LoginTrendChart.vue | 906 ++++++++++++++++++ src/views/dashboard/index.vue | 698 ++++++++++++++ src/views/dashboard/types.ts | 44 + src/views/error/403/index.vue | 8 + src/views/error/404/index.vue | 8 + src/views/error/500/index.vue | 8 + src/views/login/components/Login/index.vue | 481 ++++++++++ src/views/login/components/Register/index.vue | 123 +++ src/views/login/components/ResetPwd/index.vue | 76 ++ src/views/login/components/index.ts | 5 + src/views/login/index.vue | 191 ++++ 46 files changed, 4913 insertions(+) create mode 100644 src/assets/svg-icons/cool.svg create mode 100644 src/assets/svg-icons/logo.svg create mode 100644 src/assets/svg/error-403.svg create mode 100644 src/assets/svg/error-404.svg create mode 100644 src/assets/svg/error-500.svg create mode 100644 src/layouts/components/common/BackTop.vue create mode 100644 src/layouts/components/common/LayoutSelector.vue create mode 100644 src/layouts/components/common/NoticeList.vue create mode 100644 src/layouts/components/common/Setting.vue create mode 100644 src/layouts/components/common/SettingDrawer.vue create mode 100644 src/layouts/components/header/Breadcrumb.vue create mode 100644 src/layouts/components/header/CollapaseButton.vue create mode 100644 src/layouts/components/header/FullScreen.vue create mode 100644 src/layouts/components/header/Notices.vue create mode 100644 src/layouts/components/header/Search.vue create mode 100644 src/layouts/components/index.ts create mode 100644 src/layouts/components/sider/Logo.vue create mode 100644 src/layouts/components/sider/Menu.vue create mode 100644 src/layouts/components/tab/ContentFullScreen.vue create mode 100644 src/layouts/components/tab/DropTabs.vue create mode 100644 src/layouts/components/tab/Reload.vue create mode 100644 src/layouts/components/tab/TabBar.vue create mode 100644 src/layouts/components/tab/TabBarItem.vue create mode 100644 src/layouts/index.vue create mode 100644 src/layouts/leftMenu.layout.vue create mode 100644 src/layouts/mixMenu.layout.vue create mode 100644 src/layouts/topMenu.layout.vue create mode 100644 src/modules/assets.ts create mode 100644 src/modules/directives.ts create mode 100644 src/modules/i18n.ts create mode 100644 src/styles/index.css create mode 100644 src/styles/naive.css create mode 100644 src/styles/reset.css create mode 100644 src/styles/transition.css create mode 100644 src/views/dashboard/components/DashboardStatCard.vue create mode 100644 src/views/dashboard/components/LoginTrendChart.vue create mode 100644 src/views/dashboard/index.vue create mode 100644 src/views/dashboard/types.ts create mode 100644 src/views/error/403/index.vue create mode 100644 src/views/error/404/index.vue create mode 100644 src/views/error/500/index.vue create mode 100644 src/views/login/components/Login/index.vue create mode 100644 src/views/login/components/Register/index.vue create mode 100644 src/views/login/components/ResetPwd/index.vue create mode 100644 src/views/login/components/index.ts create mode 100644 src/views/login/index.vue diff --git a/src/assets/svg-icons/cool.svg b/src/assets/svg-icons/cool.svg new file mode 100644 index 0000000..f5839d9 --- /dev/null +++ b/src/assets/svg-icons/cool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg-icons/logo.svg b/src/assets/svg-icons/logo.svg new file mode 100644 index 0000000..fcd50e9 --- /dev/null +++ b/src/assets/svg-icons/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg/error-403.svg b/src/assets/svg/error-403.svg new file mode 100644 index 0000000..504a8a1 --- /dev/null +++ b/src/assets/svg/error-403.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg/error-404.svg b/src/assets/svg/error-404.svg new file mode 100644 index 0000000..ff6ca1f --- /dev/null +++ b/src/assets/svg/error-404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg/error-500.svg b/src/assets/svg/error-500.svg new file mode 100644 index 0000000..3f545eb --- /dev/null +++ b/src/assets/svg/error-500.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/layouts/components/common/BackTop.vue b/src/layouts/components/common/BackTop.vue new file mode 100644 index 0000000..4ddd6d6 --- /dev/null +++ b/src/layouts/components/common/BackTop.vue @@ -0,0 +1,15 @@ + + + diff --git a/src/layouts/components/common/LayoutSelector.vue b/src/layouts/components/common/LayoutSelector.vue new file mode 100644 index 0000000..c564dc9 --- /dev/null +++ b/src/layouts/components/common/LayoutSelector.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/layouts/components/common/NoticeList.vue b/src/layouts/components/common/NoticeList.vue new file mode 100644 index 0000000..328b08a --- /dev/null +++ b/src/layouts/components/common/NoticeList.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/layouts/components/common/Setting.vue b/src/layouts/components/common/Setting.vue new file mode 100644 index 0000000..adc0fb6 --- /dev/null +++ b/src/layouts/components/common/Setting.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/layouts/components/common/SettingDrawer.vue b/src/layouts/components/common/SettingDrawer.vue new file mode 100644 index 0000000..0460643 --- /dev/null +++ b/src/layouts/components/common/SettingDrawer.vue @@ -0,0 +1,148 @@ + + + diff --git a/src/layouts/components/header/Breadcrumb.vue b/src/layouts/components/header/Breadcrumb.vue new file mode 100644 index 0000000..6c31f85 --- /dev/null +++ b/src/layouts/components/header/Breadcrumb.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/src/layouts/components/header/CollapaseButton.vue b/src/layouts/components/header/CollapaseButton.vue new file mode 100644 index 0000000..e7fbecd --- /dev/null +++ b/src/layouts/components/header/CollapaseButton.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/src/layouts/components/header/FullScreen.vue b/src/layouts/components/header/FullScreen.vue new file mode 100644 index 0000000..14aa2a7 --- /dev/null +++ b/src/layouts/components/header/FullScreen.vue @@ -0,0 +1,27 @@ + + + diff --git a/src/layouts/components/header/Notices.vue b/src/layouts/components/header/Notices.vue new file mode 100644 index 0000000..32b1e80 --- /dev/null +++ b/src/layouts/components/header/Notices.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/src/layouts/components/header/Search.vue b/src/layouts/components/header/Search.vue new file mode 100644 index 0000000..52300ed --- /dev/null +++ b/src/layouts/components/header/Search.vue @@ -0,0 +1,217 @@ + + + diff --git a/src/layouts/components/index.ts b/src/layouts/components/index.ts new file mode 100644 index 0000000..e5d504d --- /dev/null +++ b/src/layouts/components/index.ts @@ -0,0 +1,26 @@ +import Setting from './common/Setting.vue' +import SettingDrawer from './common/SettingDrawer.vue' + +import Breadcrumb from './header/Breadcrumb.vue' +import CollapaseButton from './header/CollapaseButton.vue' +import FullScreen from './header/FullScreen.vue' +import Notices from './header/Notices.vue' +import Search from './header/Search.vue' + +import Logo from './sider/Logo.vue' +import Menu from './sider/Menu.vue' + +import TabBar from './tab/TabBar.vue' + +export { + Breadcrumb, + CollapaseButton, + FullScreen, + Logo, + Menu, + Notices, + Search, + Setting, + SettingDrawer, + TabBar, +} diff --git a/src/layouts/components/sider/Logo.vue b/src/layouts/components/sider/Logo.vue new file mode 100644 index 0000000..093f6f7 --- /dev/null +++ b/src/layouts/components/sider/Logo.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/src/layouts/components/sider/Menu.vue b/src/layouts/components/sider/Menu.vue new file mode 100644 index 0000000..a328b08 --- /dev/null +++ b/src/layouts/components/sider/Menu.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/layouts/components/tab/ContentFullScreen.vue b/src/layouts/components/tab/ContentFullScreen.vue new file mode 100644 index 0000000..aef3a8a --- /dev/null +++ b/src/layouts/components/tab/ContentFullScreen.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/layouts/components/tab/DropTabs.vue b/src/layouts/components/tab/DropTabs.vue new file mode 100644 index 0000000..e6225c4 --- /dev/null +++ b/src/layouts/components/tab/DropTabs.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/src/layouts/components/tab/Reload.vue b/src/layouts/components/tab/Reload.vue new file mode 100644 index 0000000..a6308b2 --- /dev/null +++ b/src/layouts/components/tab/Reload.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/layouts/components/tab/TabBar.vue b/src/layouts/components/tab/TabBar.vue new file mode 100644 index 0000000..fbb6667 --- /dev/null +++ b/src/layouts/components/tab/TabBar.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/src/layouts/components/tab/TabBarItem.vue b/src/layouts/components/tab/TabBarItem.vue new file mode 100644 index 0000000..a78266d --- /dev/null +++ b/src/layouts/components/tab/TabBarItem.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/layouts/index.vue b/src/layouts/index.vue new file mode 100644 index 0000000..dca2744 --- /dev/null +++ b/src/layouts/index.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/layouts/leftMenu.layout.vue b/src/layouts/leftMenu.layout.vue new file mode 100644 index 0000000..73a6fc3 --- /dev/null +++ b/src/layouts/leftMenu.layout.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/layouts/mixMenu.layout.vue b/src/layouts/mixMenu.layout.vue new file mode 100644 index 0000000..9920f42 --- /dev/null +++ b/src/layouts/mixMenu.layout.vue @@ -0,0 +1,157 @@ + + + diff --git a/src/layouts/topMenu.layout.vue b/src/layouts/topMenu.layout.vue new file mode 100644 index 0000000..a09064f --- /dev/null +++ b/src/layouts/topMenu.layout.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/modules/assets.ts b/src/modules/assets.ts new file mode 100644 index 0000000..3c4eb31 --- /dev/null +++ b/src/modules/assets.ts @@ -0,0 +1,6 @@ +import 'uno.css' +import '@/styles/index.css' + +// 全局引入的静态资源 +export function install() { +} diff --git a/src/modules/directives.ts b/src/modules/directives.ts new file mode 100644 index 0000000..0f73430 --- /dev/null +++ b/src/modules/directives.ts @@ -0,0 +1,10 @@ +import type { App } from 'vue' + +export function install(app: App) { + /* 自动注册指令 */ + Object.values( + import.meta.glob<{ install: (app: App) => void }>('@/directives/*.ts', { + eager: true, + }), + ).map(i => app.use(i)) +} diff --git a/src/modules/i18n.ts b/src/modules/i18n.ts new file mode 100644 index 0000000..494fe24 --- /dev/null +++ b/src/modules/i18n.ts @@ -0,0 +1,26 @@ +import type { App } from 'vue' +import { local } from '@/utils' +import { createI18n } from 'vue-i18n' +import enUS from '../../locales/en_US.json' +import zhCN from '../../locales/zh_CN.json' + +const { VITE_DEFAULT_LANG } = import.meta.env + +export const i18n = createI18n({ + legacy: false, + locale: local.get('lang') || VITE_DEFAULT_LANG, // 默认显示语言 + fallbackLocale: VITE_DEFAULT_LANG, + messages: { + zhCN, + enUS, + }, + // 缺失国际化键警告 + // missingWarn: false, + + // 缺失回退内容警告 + fallbackWarn: false, +}) + +export function install(app: App) { + app.use(i18n) +} diff --git a/src/styles/index.css b/src/styles/index.css new file mode 100644 index 0000000..5c75a34 --- /dev/null +++ b/src/styles/index.css @@ -0,0 +1,20 @@ +@import './reset.css'; +@import './transition.css'; +@import './naive.css'; + +html, +body, +#app { + height: 100%; +} +.color-weak { + filter: invert(80%); +} + +.gray-mode { + filter: grayscale(100%); +} + +.drag-handle { + cursor: move; +} diff --git a/src/styles/naive.css b/src/styles/naive.css new file mode 100644 index 0000000..cd11708 --- /dev/null +++ b/src/styles/naive.css @@ -0,0 +1,14 @@ +.n-modal-mask { + backdrop-filter: blur(2px); +} + +/* 解决tabs组件不贴合下边缘问题 */ +.v-x-scroll { + height: 100%; +} + +/* 解决二维码尺寸问题 */ +.n-qr-code{ + height: unset !important; + width: unset !important;; +} diff --git a/src/styles/reset.css b/src/styles/reset.css new file mode 100644 index 0000000..f39fb58 --- /dev/null +++ b/src/styles/reset.css @@ -0,0 +1,403 @@ +/* +1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) +2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) +*/ + +*, +::before, +::after { + box-sizing: border-box; + /* 1 */ + border-width: 0; + /* 2 */ + border-style: solid; + /* 2 */ + border-color: currentColor; + /* 2 */ +} + +/* +1. Use a consistent sensible line-height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +3. Use a more readable tab size. +4. Use the user's configured `sans` font-family by default. +*/ + +html { + line-height: 1.5; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -moz-tab-size: 4; + /* 3 */ + tab-size: 4; + /* 3 */ + font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + /* 4 */ +} + +/* +1. Remove the margin in all browsers. +2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. +*/ + +body { + margin: 0; + /* 1 */ + line-height: inherit; + /* 2 */ +} + +/* +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +3. Ensure horizontal rules are visible by default. +*/ + +hr { + height: 0; + /* 1 */ + color: inherit; + /* 2 */ + border-top-width: 1px; + /* 3 */ +} + +/* +Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +abbr:where([title]) { + text-decoration: underline dotted; +} + +/* +Remove the default font size and weight for headings. +*/ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: inherit; + font-weight: inherit; +} + +/* +Reset links to optimize for opt-in styling instead of opt-out. +*/ + +a { + color: inherit; + text-decoration: inherit; +} + +/* +Add the correct font weight in Edge and Safari. +*/ + +b, +strong { + font-weight: bolder; +} + +/* +1. Use the user's configured `mono` font family by default. +2. Correct the odd `em` font sizing in all browsers. +*/ + +code, +kbd, +samp, +pre { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + +/* +Add the correct font size in all browsers. +*/ + +small { + font-size: 80%; +} + +/* +Prevent `sub` and `sup` elements from affecting the line height in all browsers. +*/ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +3. Remove gaps between table borders by default. +*/ + +table { + text-indent: 0; + /* 1 */ + border-color: inherit; + /* 2 */ + border-collapse: collapse; + /* 3 */ +} + +/* +1. Change the font styles in all browsers. +2. Remove the margin in Firefox and Safari. +3. Remove default padding in all browsers. +*/ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; + /* 1 */ + font-size: 100%; + /* 1 */ + line-height: inherit; + /* 1 */ + color: inherit; + /* 1 */ + margin: 0; + /* 2 */ + padding: 0; + /* 3 */ +} + +/* +Remove the inheritance of text transform in Edge and Firefox. +*/ + +button, +select { + text-transform: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Remove default button styles. +*/ + +button, +[type='button'], +[type='reset'], +[type='submit'] { + -webkit-appearance: button; + /* 1 */ + /* background-color: transparent; 2 */ + background-image: none; + /* 2 */ +} + +/* +Use the modern Firefox focus style for all focusable elements. +*/ + +:-moz-focusring { + outline: auto; +} + +/* +Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/* +Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/* +Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/* +1. Correct the odd appearance in Chrome and Safari. +2. Correct the outline style in Safari. +*/ + +[type='search'] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ +} + +/* +Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Change font properties to `inherit` in Safari. +*/ + +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ +} + +/* +Add the correct display in Chrome and Safari. +*/ + +summary { + display: list-item; +} + +/* +Removes the default spacing and border for appropriate elements. +*/ + +blockquote, +dl, +dd, +h1, +h2, +h3, +h4, +h5, +h6, +hr, +figure, +p, +pre { + margin: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +legend { + padding: 0; +} + +ol, +ul, +menu { + list-style: none; + margin: 0; + padding: 0; +} + +/* +Prevent resizing textareas horizontally by default. +*/ + +textarea { + resize: vertical; +} + +/* +1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +2. Set the default placeholder color to the user's configured gray 400 color. +*/ + +input::placeholder, +textarea::placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +/* +Set the default cursor for buttons. +*/ + +button, +[role='button'] { + cursor: pointer; +} + +/* +Make sure disabled buttons don't get the pointer cursor. +*/ +:disabled { + cursor: default; +} + +/* +1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) +2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; + /* 1 */ + vertical-align: middle; + /* 2 */ + object-fit: cover; +} + +/* +Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + +img, +video { + max-width: 100%; + height: auto; +} + +/* +Ensure the default browser behavior of the `hidden` attribute. +*/ + +[hidden] { + display: none; +} + +.dark { + color-scheme: dark; +} diff --git a/src/styles/transition.css b/src/styles/transition.css new file mode 100644 index 0000000..f08305c --- /dev/null +++ b/src/styles/transition.css @@ -0,0 +1,92 @@ +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.3s ease-in-out; +} +.fade-enter-from, +.fade-leave-to { + opacity: 0; +} + +/* fade-slide */ +.fade-slide-leave-active, +.fade-slide-enter-active { + transition: all 0.3s; +} +.fade-slide-enter-from { + opacity: 0; + transform: translateX(-30px); +} +.fade-slide-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* fade-bottom */ +.fade-bottom-enter-active, +.fade-bottom-leave-active { + transition: opacity 0.25s, transform 0.3s; +} +.fade-bottom-enter-from { + opacity: 0; + transform: translateY(-10%); +} +.fade-bottom-leave-to { + opacity: 0; + transform: translateY(10%); +} + +/* fade-scale */ +.fade-scale-leave-active, +.fade-scale-enter-active { + transition: all 0.28s; +} +.fade-scale-enter-from { + opacity: 0; + transform: scale(1.2); +} +.fade-scale-leave-to { + opacity: 0; + transform: scale(0.8); +} + +/* zoom-fade */ +.zoom-fade-enter-active, +.zoom-fade-leave-active { + transition: transform 0.2s, opacity 0.3s ease-out; +} +.zoom-fade-enter-from { + opacity: 0; + transform: scale(0.92); +} +.zoom-fade-leave-to { + opacity: 0; + transform: scale(1.06); +} + +/* zoom-out */ +.zoom-out-enter-active, +.zoom-out-leave-active { + transition: opacity 0.1s ease-in-out, transform 0.15s ease-out; +} +.zoom-out-enter-from, +.zoom-out-leave-to { + opacity: 0; + transform: scale(0); +} + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.2s, filter 0.2s ease-out; +} + +.fade-enter-from { + opacity: 0; + filter: blur(10px); +} + +.fade-leave-to { + opacity: 0; + filter: blur(0px); +} diff --git a/src/views/dashboard/components/DashboardStatCard.vue b/src/views/dashboard/components/DashboardStatCard.vue new file mode 100644 index 0000000..8aef0b2 --- /dev/null +++ b/src/views/dashboard/components/DashboardStatCard.vue @@ -0,0 +1,283 @@ + + + + + diff --git a/src/views/dashboard/components/LoginTrendChart.vue b/src/views/dashboard/components/LoginTrendChart.vue new file mode 100644 index 0000000..e72f7f9 --- /dev/null +++ b/src/views/dashboard/components/LoginTrendChart.vue @@ -0,0 +1,906 @@ + + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue new file mode 100644 index 0000000..eb11724 --- /dev/null +++ b/src/views/dashboard/index.vue @@ -0,0 +1,698 @@ + + + + + diff --git a/src/views/dashboard/types.ts b/src/views/dashboard/types.ts new file mode 100644 index 0000000..39a190f --- /dev/null +++ b/src/views/dashboard/types.ts @@ -0,0 +1,44 @@ +// 仪表盘数据类型定义 + +// 从API模块重新导出类型,保持一致性 +export type { + DailyActivityStatsVo as DailyActivityStats, + LoginStatsVo as LoginStats, + LoginTrendItemVo, + StorageStatsVo as StorageStats, + UserStatsVo as UserStats, +} from '@/service/api/dashboard' + +// 完整的仪表盘数据结构(与后端API保持一致) +export interface DashboardData { + userStats: UserStats + loginStats: LoginStats + storageStats: StorageStats + dailyActivityStats: DailyActivityStats +} + +// 图表数据点类型 +export interface ChartDataPoint { + name: string + value: number + color?: string +} + +// 趋势数据类型 +export interface TrendData { + label: string + value: number + date: string +} + +// 统计卡片属性类型 +export interface StatCardProps { + title: string + value: number | string + subtitle: string + extraInfo?: string + trend?: string + trendUp?: boolean + icon: string + color: string +} diff --git a/src/views/error/403/index.vue b/src/views/error/403/index.vue new file mode 100644 index 0000000..4435b84 --- /dev/null +++ b/src/views/error/403/index.vue @@ -0,0 +1,8 @@ + + + + + diff --git a/src/views/error/404/index.vue b/src/views/error/404/index.vue new file mode 100644 index 0000000..876d0d0 --- /dev/null +++ b/src/views/error/404/index.vue @@ -0,0 +1,8 @@ + + + + + diff --git a/src/views/error/500/index.vue b/src/views/error/500/index.vue new file mode 100644 index 0000000..820af9a --- /dev/null +++ b/src/views/error/500/index.vue @@ -0,0 +1,8 @@ + + + + + diff --git a/src/views/login/components/Login/index.vue b/src/views/login/components/Login/index.vue new file mode 100644 index 0000000..c538147 --- /dev/null +++ b/src/views/login/components/Login/index.vue @@ -0,0 +1,481 @@ + + + + + diff --git a/src/views/login/components/Register/index.vue b/src/views/login/components/Register/index.vue new file mode 100644 index 0000000..51e4440 --- /dev/null +++ b/src/views/login/components/Register/index.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/src/views/login/components/ResetPwd/index.vue b/src/views/login/components/ResetPwd/index.vue new file mode 100644 index 0000000..93c9827 --- /dev/null +++ b/src/views/login/components/ResetPwd/index.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/views/login/components/index.ts b/src/views/login/components/index.ts new file mode 100644 index 0000000..9dab8c9 --- /dev/null +++ b/src/views/login/components/index.ts @@ -0,0 +1,5 @@ +import Login from './Login/index.vue' +import Register from './Register/index.vue' +import ResetPwd from './ResetPwd/index.vue' + +export { Login, Register, ResetPwd } diff --git a/src/views/login/index.vue b/src/views/login/index.vue new file mode 100644 index 0000000..cbc6190 --- /dev/null +++ b/src/views/login/index.vue @@ -0,0 +1,191 @@ + + + + +