This commit is contained in:
2026-01-26 10:01:44 +08:00
parent 3f58d013ca
commit 2a9cb82fef
9 changed files with 494 additions and 527 deletions
+4 -2
View File
@@ -1,4 +1,5 @@
<template><el-breadcrumb separator="/">
<template>
<el-breadcrumb separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
<span v-if="index === breadcrumbs.length - 1" class="no-redirect">
@@ -9,7 +10,8 @@
</a>
</el-breadcrumb-item>
</transition-group>
</el-breadcrumb></template>
</el-breadcrumb>
</template>
<script setup>
import { computed } from 'vue'
+4 -2
View File
@@ -1,4 +1,5 @@
<template><template v-for="menu in menuList" :key="menu.path">
<template>
<template v-for="menu in menuList" :key="menu.path">
<!-- 有子菜单 -->
<el-sub-menu v-if="hasChildren(menu) && !menu.meta?.hidden" :index="menu.path">
<template #title>
@@ -20,7 +21,8 @@
<span>{{ menu.meta?.title }}</span>
</template>
</el-menu-item>
</template></template>
</template>
</template>
<script setup>
defineOptions({
+4 -3
View File
@@ -1,5 +1,5 @@
<template><el-menu :default-active="activeMenu" :mode="menuMode" :collapse="isCollapse" :unique-opened="uniqueOpened"
:router="true" :collapse-transition="false" @select="handleSelect">
<template>
<el-menu :default-active="activeMenu" :mode="menuMode" :collapse="isCollapse" :unique-opened="uniqueOpened" :router="true" :collapse-transition="false" @select="handleSelect">
<template v-for="menu in menuList" :key="menu.path">
<!-- 有子菜单 -->
<el-sub-menu v-if="hasChildren(menu) && !menu.meta?.hidden" :index="menu.path">
@@ -23,7 +23,8 @@
</template>
</el-menu-item>
</template>
</el-menu></template>
</el-menu>
</template>
<script setup>
import { computed } from 'vue'
+3 -15
View File
@@ -52,13 +52,10 @@
<div class="setting-title">主题色</div>
<div class="setting-value">
<div class="color-picker-wrapper">
<el-color-picker v-model="themeColor" show-alpha :predefine="predefineColors"
@change="handleThemeColorChange" />
<el-color-picker v-model="themeColor" show-alpha :predefine="predefineColors" @change="handleThemeColorChange" />
</div>
<div class="color-presets">
<div v-for="color in predefineColors" :key="color" class="color-preset"
:class="{ active: themeColor === color }" :style="{ backgroundColor: color }"
@click="handleColorPresetClick(color)"></div>
<div v-for="color in predefineColors" :key="color" class="color-preset" :class="{ active: themeColor === color }" :style="{ backgroundColor: color }" @click="handleColorPresetClick(color)"></div>
</div>
</div>
</div>
@@ -137,14 +134,7 @@
<script setup>
import { ref, computed, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import {
Setting,
Sunny,
Moon,
QuestionFilled,
Check,
RefreshLeft,
} from '@element-plus/icons-vue'
import { Setting, Sunny, Moon, QuestionFilled, Check, RefreshLeft } from '@element-plus/icons-vue'
import { useLayoutStore } from '@/stores/modules/layout'
defineOptions({
@@ -267,7 +257,6 @@ onMounted(() => {
<style lang="scss" scoped>
.setting-container {
// 设置按钮
.setting-btn {
position: fixed;
@@ -321,7 +310,6 @@ onMounted(() => {
}
.setting-value {
// 布局选项
:deep(.el-radio-group) {
width: 100%;
+1 -3
View File
@@ -1,9 +1,7 @@
<template>
<div class="tags-view-container">
<el-scrollbar class="tags-view-wrapper">
<router-link v-for="tag in visibleTags" :key="tag.fullPath" :class="isActive(tag) ? 'active' : ''"
class="tags-view-item" :to="{ path: tag.fullPath }" @click.middle="closeTag(tag)"
@contextmenu.prevent="openMenu(tag, $event)">
<router-link v-for="tag in visibleTags" :key="tag.fullPath" :class="isActive(tag) ? 'active' : ''" class="tags-view-item" :to="{ path: tag.fullPath }" @click.middle="closeTag(tag)" @contextmenu.prevent="openMenu(tag, $event)">
{{ tag.title || tag.meta?.title }}
<el-icon v-if="!tag.meta?.affix" class="el-icon-close" @click.prevent.stop="closeTag(tag)">
<Close />
+3 -20
View File
@@ -21,12 +21,8 @@
</div>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item :disabled="currentLanguage === 'zh-CN'" command="zh-CN">
简体中文
</el-dropdown-item>
<el-dropdown-item :disabled="currentLanguage === 'en-US'" command="en-US">
English
</el-dropdown-item>
<el-dropdown-item :disabled="currentLanguage === 'zh-CN'" command="zh-CN"> 简体中文 </el-dropdown-item>
<el-dropdown-item :disabled="currentLanguage === 'en-US'" command="en-US"> English </el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@@ -113,20 +109,7 @@
import { computed, ref, onMounted, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessageBox, ElMessage } from 'element-plus'
import {
ArrowDown,
HomeFilled,
User,
Setting,
SwitchButton,
FullScreen,
Aim,
Location,
Sunny,
Moon,
Bell,
UserFilled,
} from '@element-plus/icons-vue'
import { ArrowDown, HomeFilled, User, Setting, SwitchButton, FullScreen, Aim, Location, Sunny, Moon, Bell, UserFilled } from '@element-plus/icons-vue'
import { useUserStore } from '@/stores/modules/user'
import { useI18nStore } from '@/stores/modules/i18n'
+5 -10
View File
@@ -1,4 +1,5 @@
<template><el-container class="app-wrapper" :class="layoutClass">
<template>
<el-container class="app-wrapper" :class="layoutClass">
<!-- 默认布局左侧双栏布局 -->
<template v-if="layoutMode === 'default'">
<!-- 一级菜单栏 (窄侧边栏) -->
@@ -8,8 +9,7 @@
<span v-else class="logo-text-mini">{{ logoText }}</span>
</div>
<div class="menu-list">
<div v-for="menu in parentMenus" :key="menu.path" class="menu-item"
:class="{ active: selectedParentMenu?.path === menu.path }" @click="handleParentMenuClick(menu)">
<div v-for="menu in parentMenus" :key="menu.path" class="menu-item" :class="{ active: selectedParentMenu?.path === menu.path }" @click="handleParentMenuClick(menu)">
<el-icon v-if="menu.meta?.icon">
<component :is="menu.meta.icon" />
</el-icon>
@@ -165,9 +165,7 @@ const layoutClass = computed(() => {
// 缓存的视图
const cachedViews = computed(() => {
return viewTags.value
.filter((tag) => tag.meta?.keepAlive)
.map((tag) => tag.name)
return viewTags.value.filter((tag) => tag.meta?.keepAlive).map((tag) => tag.name)
})
// 父级菜单(一级菜单)
@@ -213,10 +211,7 @@ watch(
if (layoutMode.value === 'default') {
const menus = userStore.getMenu() || []
for (const parentMenu of menus) {
if (
parentMenu.children &&
parentMenu.children.some((child) => route.path.startsWith(child.path))
) {
if (parentMenu.children && parentMenu.children.some((child) => route.path.startsWith(child.path))) {
layoutStore.setSelectedParentMenu(parentMenu)
break
}
+1 -1
View File
@@ -3,6 +3,6 @@
</template>
<script setup>
defineOptions({
name: 'HomeIndex'
name: 'HomeIndex',
})
</script>
+2 -4
View File
@@ -12,8 +12,7 @@
<p class="auth-subtitle">登录您的账户继续探索科技世界</p>
</div>
<el-form ref="loginFormRef" :model="loginForm" :rules="loginRules" class="auth-form"
@submit.prevent="handleLogin">
<el-form ref="loginFormRef" :model="loginForm" :rules="loginRules" class="auth-form" @submit.prevent="handleLogin">
<el-form-item prop="username">
<el-input v-model="loginForm.username" placeholder="请输入用户名/邮箱" size="large" clearable>
<template #prefix>
@@ -25,8 +24,7 @@
</el-form-item>
<el-form-item prop="password">
<el-input v-model="loginForm.password" type="password" placeholder="请输入密码" size="large" clearable
show-password @keyup.enter="handleLogin">
<el-input v-model="loginForm.password" type="password" placeholder="请输入密码" size="large" clearable show-password @keyup.enter="handleLogin">
<template #prefix>
<el-icon>
<Lock />