From 5777d648219b5888a58b41d5548047b234eb4b5e Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Thu, 27 Aug 2026 15:40:05 +0800 Subject: [PATCH] refactor: update styles to use CSS variables for consistency and theming - Replaced hardcoded colors and styles with CSS variables in multiple components including `index.vue`, `lock.vue`, `login.vue`, and `register.vue`. - Improved layout and spacing in forms and containers for better responsiveness. - Removed unused particle background animation from `lock.vue`. - Added new SCSS file for Element Plus theme customization. - Introduced a minimalist CSS file for global styles and variables. --- .env.development | 4 +- src/App.vue | 8 +- src/assets/styles/index.scss | 14 +- src/assets/styles/ruoyi.scss | 7 +- src/assets/styles/sidebar.scss | 30 +- src/assets/styles/variables.module.scss | 32 +- src/components/EditTable/index.vue | 25 +- src/components/HeaderSearch/index.vue | 2 +- src/components/ImagePreview/index.vue | 14 +- src/components/TreePanel/index.vue | 49 +-- src/layout/components/AppMain.vue | 26 +- src/layout/components/Copyright/index.vue | 8 +- src/layout/components/Navbar.vue | 42 +- src/layout/components/Settings/index.vue | 4 +- src/layout/components/Sidebar/Logo.vue | 10 +- src/layout/components/Sidebar/index.vue | 26 +- src/layout/components/TagsView/index.vue | 55 +-- src/layout/components/TopBar/index.vue | 12 +- src/layout/components/TopNav/index.vue | 26 +- src/layout/index.vue | 6 +- src/main.js | 1 + src/settings.js | 2 +- src/store/modules/settings.js | 2 +- src/style/variable.scss | 6 +- src/styles/element/index.scss | 68 ++++ src/styles/minimalist.css | 362 ++++++++++++++++++ src/utils/theme.js | 3 + .../corpus/components/CategoryTree.vue | 15 +- .../corpus/components/CorpusList.vue | 11 +- .../corpus/components/StatCards.vue | 73 ++-- .../components/AudioPlayer.vue | 56 +-- .../components/MainWorkspace.vue | 25 +- .../speech_synthesis/components/StatCards.vue | 81 ++-- .../speech_synthesis/components/TaskList.vue | 15 +- src/views/device/register/index.vue | 22 +- src/views/device/robotManger/ContextMenu.vue | 17 +- .../device/robotManger/TechButtonWithLine.vue | 139 +++---- src/views/device/robotManger/index.vue | 58 +-- src/views/flow/components/Aside.vue | 49 ++- src/views/flow/components/OuterNode.vue | 8 +- src/views/flow/index.vue | 76 ++-- src/views/flow/nodes/function/stopLoop.vue | 24 +- src/views/flow/vue-flow/FlowNode.vue | 65 ++-- src/views/index.vue | 126 +++--- .../inspection/cockpit/components/Header.vue | 45 +-- .../ManualTakeover/DirectionControl.vue | 54 +++ .../ManualTakeover/VoiceConversation.vue | 142 +++++++ .../cockpit/components/MapOverview.vue | 12 +- .../inspection/cockpit/components/Monitor.vue | 4 +- src/views/inspection/cockpit/index.vue | 184 ++++++++- src/views/inspection/runTask/index.vue | 42 +- .../intelligenceTest/runningTask/index.vue | 42 +- src/views/lock.vue | 150 +++----- src/views/login.vue | 43 ++- src/views/register.vue | 44 ++- 55 files changed, 1607 insertions(+), 859 deletions(-) create mode 100644 src/styles/element/index.scss create mode 100644 src/styles/minimalist.css diff --git a/.env.development b/.env.development index 10db161..a5744e5 100644 --- a/.env.development +++ b/.env.development @@ -7,8 +7,8 @@ VITE_APP_ENV = 'development' # 招商车研物联网平台/开发环境 VITE_APP_BASE_API = '/dev-api' -VITE_API_URL = http://192.168.0.222:13080 -VITE_WS_URL = ws://192.168.0.222:13080/ws +VITE_API_URL = http://192.168.0.199:13080 +VITE_WS_URL = ws://192.168.0.199:13080/ws VITE_PORT = 80 VITE_INSPECTION_TYPE = "inspection" VITE_MINIO_URL = "http://192.168.28.10:9000/cmvr-iot/" diff --git a/src/App.vue b/src/App.vue index 498b169..1a79052 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,7 +16,7 @@ onMounted(() => { diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue index 234531b..8fe7a43 100644 --- a/src/components/HeaderSearch/index.vue +++ b/src/components/HeaderSearch/index.vue @@ -271,7 +271,7 @@ watch(searchPool, (list) => { padding-left: 0; padding-right: 0; box-shadow: none !important; - border-bottom: 1px solid #d9d9d9; + border-bottom: 1px solid var(--min-border-light); vertical-align: middle; } } diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue index acd05c5..113986b 100644 --- a/src/components/ImagePreview/index.vue +++ b/src/components/ImagePreview/index.vue @@ -69,14 +69,16 @@ const realHeight = computed(() => @@ -78,12 +75,9 @@ function addIframe() { height: 6px; } -::-webkit-scrollbar-track { - background-color: #f1f1f1; -} - -::-webkit-scrollbar-thumb { - background-color: #c0c0c0; - border-radius: 3px; +@media (max-width: 768px) { + .app-main { + padding: 16px; + } } diff --git a/src/layout/components/Copyright/index.vue b/src/layout/components/Copyright/index.vue index ed589de..693c66e 100644 --- a/src/layout/components/Copyright/index.vue +++ b/src/layout/components/Copyright/index.vue @@ -22,10 +22,10 @@ const content = computed(() => settingsStore.footerContent) height: 36px; padding: 10px 20px; text-align: right; - background-color: #f8f8f8; - color: #666; + background-color: var(--min-bg-page); + color: var(--min-text-secondary); font-size: 14px; - border-top: 1px solid #e7e7e7; + border-top: 1px solid var(--min-border-light); z-index: 999; } - \ No newline at end of file + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 00a0867..a92c654 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -175,14 +175,16 @@ async function toggleTheme(event) { \ No newline at end of file + diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue index 0373c4e..dee7020 100644 --- a/src/layout/components/Sidebar/Logo.vue +++ b/src/layout/components/Sidebar/Logo.vue @@ -67,8 +67,8 @@ const getLogoTextColor = computed(() => { .sidebar-logo-container { position: relative; width: 100%; - height: 50px; - line-height: 50px; + height: 56px; + line-height: 56px; background: v-bind(getLogoBackground); text-align: center; overflow: hidden; @@ -78,8 +78,8 @@ const getLogoTextColor = computed(() => { width: 100%; & .sidebar-logo { - width: 32px; - height: 32px; + width: 28px; + height: 28px; vertical-align: middle; margin-right: 12px; } @@ -89,7 +89,7 @@ const getLogoTextColor = computed(() => { margin: 0; color: v-bind(getLogoTextColor); font-weight: 600; - line-height: 50px; + line-height: 56px; font-size: 14px; font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; vertical-align: middle; diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 33e1141..bfe790e 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -80,10 +80,20 @@ const activeMenu = computed(() => { border: none; height: 100%; width: 100% !important; + + .el-menu-item, + .el-sub-menu__title { + height: 48px; + line-height: 48px; + margin: 2px 8px; + border-radius: var(--min-radius-sm); + font-size: 14px; + font-weight: 500; + } .el-menu-item, .el-sub-menu__title { &:hover { - background-color: var(--menu-hover, rgba(0, 0, 0, 0.06)) !important; + background-color: var(--menu-hover) !important; } } @@ -91,8 +101,18 @@ const activeMenu = computed(() => { color: v-bind(getMenuTextColor); &.is-active { - color: var(--menu-active-text, #409eff); - background-color: var(--menu-hover, rgba(0, 0, 0, 0.06)) !important; + color: var(--menu-active-text); + background-color: var(--min-primary-soft) !important; + + &::before { + content: ''; + position: absolute; + top: 12px; + bottom: 12px; + left: 0; + width: 2px; + background: var(--min-primary); + } } } diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index 2fa2c69..e03f766 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -8,7 +8,6 @@ :class="isActive(tag) ? 'active' : ''" :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" class="tags-view-item" - :style="activeStyle(tag)" @click.middle="!isAffix(tag) ? closeSelectedTag(tag) : ''" @contextmenu.prevent="openMenu(tag, $event)" > @@ -45,7 +44,6 @@ import ScrollPane from './ScrollPane' import { getNormalPath } from '@/utils/ruoyi' import useTagsViewStore from '@/store/modules/tagsView' -import useSettingsStore from '@/store/modules/settings' import usePermissionStore from '@/store/modules/permission' const visible = ref(false); @@ -61,7 +59,6 @@ const router = useRouter(); const visitedViews = computed(() => useTagsViewStore().visitedViews); const routes = computed(() => usePermissionStore().routes); -const theme = computed(() => useSettingsStore().theme); watch(route, () => { addTags() @@ -85,14 +82,6 @@ function isActive(r) { return r.path === route.path } -function activeStyle(tag) { - if (!isActive(tag)) return {}; - return { - "background-color": theme.value, - "border-color": theme.value - }; -} - function isAffix(tag) { return tag.meta && tag.meta.affix } @@ -259,50 +248,40 @@ function handleScroll() { diff --git a/src/layout/components/TopNav/index.vue b/src/layout/components/TopNav/index.vue index 3810cfe..3a8e461 100644 --- a/src/layout/components/TopNav/index.vue +++ b/src/layout/components/TopNav/index.vue @@ -172,37 +172,37 @@ onMounted(() => { \ No newline at end of file + diff --git a/src/views/corpusManger/corpus/components/CorpusList.vue b/src/views/corpusManger/corpus/components/CorpusList.vue index bb2ccc3..4b51de0 100644 --- a/src/views/corpusManger/corpus/components/CorpusList.vue +++ b/src/views/corpusManger/corpus/components/CorpusList.vue @@ -274,9 +274,10 @@ onBeforeUnmount(() => { \ No newline at end of file + diff --git a/src/views/corpusManger/corpus/components/StatCards.vue b/src/views/corpusManger/corpus/components/StatCards.vue index 32bdb07..83c3f27 100644 --- a/src/views/corpusManger/corpus/components/StatCards.vue +++ b/src/views/corpusManger/corpus/components/StatCards.vue @@ -3,7 +3,7 @@