All checks were successful
Build and Deploy Front / deploy (push) Successful in 12m44s
EOF Co-authored-by: Cursor <cursoragent@cursor.com>
103 lines
2.5 KiB
Vue
103 lines
2.5 KiB
Vue
<template>
|
|
<a-config-provider :locale="locale">
|
|
<router-view />
|
|
<GlobalSetting v-if="showGlobalSetting" />
|
|
</a-config-provider>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { computed } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
|
|
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
|
|
import useLocale from '@/hooks/locale';
|
|
import { isLoginRouteName } from '@/utils/login-portal';
|
|
|
|
import GlobalSetting from '@/components/global-setting/index.vue';
|
|
|
|
const route = useRoute();
|
|
|
|
function isStandalonePortalPath(path: string) {
|
|
return (
|
|
path === '/' ||
|
|
path.startsWith('/h5') ||
|
|
path.startsWith('/wechat/') ||
|
|
path === '/track/query' ||
|
|
path.startsWith('/track/query/')
|
|
);
|
|
}
|
|
|
|
function isLoginPath(path: string) {
|
|
return path === '/login' || path === '/admin' || path === '/h5/login';
|
|
}
|
|
|
|
const showGlobalSetting = computed(() => {
|
|
const path = String(route.path || '');
|
|
if (isStandalonePortalPath(path)) return false;
|
|
if (isLoginPath(path)) return false;
|
|
const name = route.name ? String(route.name) : '';
|
|
if (name && isLoginRouteName(name)) return false;
|
|
return true;
|
|
});
|
|
|
|
const { currentLocale } = useLocale();
|
|
const locale = computed(() => {
|
|
switch (currentLocale.value) {
|
|
case 'zh-CN':
|
|
return zhCN;
|
|
case 'en-US':
|
|
return enUS;
|
|
default:
|
|
return enUS;
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
/* 侧边菜单栏背景(主题色变量) */
|
|
.main-menu {
|
|
background: var(--app-sidebar-bg) !important;
|
|
}
|
|
|
|
/* 针对Vue scoped样式的强制覆盖 */
|
|
[data-v-eb552580].main-menu {
|
|
background: var(--app-sidebar-bg) !important;
|
|
}
|
|
|
|
.main-menu[data-v-eb552580] {
|
|
background: var(--app-sidebar-bg) !important;
|
|
}
|
|
|
|
div.main-menu[data-v-eb552580] {
|
|
background: var(--app-sidebar-bg) !important;
|
|
}
|
|
|
|
/* 使用最高优先级的选择器 */
|
|
html body .main-menu {
|
|
background: var(--app-sidebar-bg) !important;
|
|
}
|
|
|
|
/* 主菜单文字样式覆盖 */
|
|
.main-menu .menu-text {
|
|
font-size: 12px !important;
|
|
font-weight: bold !important;
|
|
}
|
|
|
|
/* 针对Vue scoped样式的文字覆盖 */
|
|
[data-v-eb552580] .menu-text {
|
|
font-size: 12px !important;
|
|
font-weight: bold !important;
|
|
}
|
|
|
|
.main-menu[data-v-eb552580] .menu-text {
|
|
font-size: 12px !important;
|
|
font-weight: bold !important;
|
|
}
|
|
|
|
/* 最高优先级选择器 */
|
|
html body .main-menu .menu-text {
|
|
font-size: 12px !important;
|
|
font-weight: bold !important;
|
|
}
|
|
</style>
|