|
@@ -3,17 +3,19 @@
|
|
|
<transition name="sidebarLogoFade">
|
|
<transition name="sidebarLogoFade">
|
|
|
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
|
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
|
|
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
|
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
|
|
- <h1 v-else class="sidebar-title">{{ title }}</h1>
|
|
|
|
|
|
|
+ <span v-else class="sidebar-title">{{ title }}</span>
|
|
|
</router-link>
|
|
</router-link>
|
|
|
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
|
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
|
|
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
|
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
|
|
- <h1 class="sidebar-title">{{ title }}</h1>
|
|
|
|
|
|
|
+ <span class="sidebar-title">{{ title }}</span>
|
|
|
</router-link>
|
|
</router-link>
|
|
|
</transition>
|
|
</transition>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
|
+import { computed, ref } from 'vue'
|
|
|
|
|
+import { useDark } from '@vueuse/core'
|
|
|
import logo from '@/assets/logo/logo.png'
|
|
import logo from '@/assets/logo/logo.png'
|
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
|
import variables from '@/assets/styles/variables.module.scss'
|
|
import variables from '@/assets/styles/variables.module.scss'
|
|
@@ -25,24 +27,18 @@ defineProps({
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const title = import.meta.env.VITE_APP_TITLE
|
|
|
|
|
const settingsStore = useSettingsStore()
|
|
const settingsStore = useSettingsStore()
|
|
|
const sideTheme = computed(() => settingsStore.sideTheme)
|
|
const sideTheme = computed(() => settingsStore.sideTheme)
|
|
|
|
|
+const isDark = useDark()
|
|
|
|
|
|
|
|
-// 获取Logo背景色
|
|
|
|
|
-const getLogoBackground = computed(() => {
|
|
|
|
|
- if (settingsStore.isDark) {
|
|
|
|
|
- return 'var(--sidebar-bg)'
|
|
|
|
|
- }
|
|
|
|
|
- if (settingsStore.navType == 3) {
|
|
|
|
|
- return variables.menuLightBg
|
|
|
|
|
- }
|
|
|
|
|
- return sideTheme.value === 'theme-dark' ? variables.menuBg : variables.menuLightBg
|
|
|
|
|
-})
|
|
|
|
|
|
|
+const title = ref(
|
|
|
|
|
+ import.meta.env.VITE_APP_SIDEBAR_TITLE ||
|
|
|
|
|
+ import.meta.env.VITE_APP_TITLE ||
|
|
|
|
|
+ '机器人运维管理系统'
|
|
|
|
|
+)
|
|
|
|
|
|
|
|
-// 获取Logo文字颜色
|
|
|
|
|
const getLogoTextColor = computed(() => {
|
|
const getLogoTextColor = computed(() => {
|
|
|
- if (settingsStore.isDark) {
|
|
|
|
|
|
|
+ if (isDark.value) {
|
|
|
return 'var(--sidebar-logo-text)'
|
|
return 'var(--sidebar-logo-text)'
|
|
|
}
|
|
}
|
|
|
if (settingsStore.navType == 3) {
|
|
if (settingsStore.navType == 3) {
|
|
@@ -50,6 +46,16 @@ const getLogoTextColor = computed(() => {
|
|
|
}
|
|
}
|
|
|
return sideTheme.value === 'theme-dark' ? '#fff' : variables.menuLightText
|
|
return sideTheme.value === 'theme-dark' ? '#fff' : variables.menuLightText
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+const getLogoBackground = computed(() => {
|
|
|
|
|
+ if (isDark.value) {
|
|
|
|
|
+ return 'var(--sidebar-bg)'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (settingsStore.navType == 3) {
|
|
|
|
|
+ return variables.menuLightBg
|
|
|
|
|
+ }
|
|
|
|
|
+ return sideTheme.value === 'theme-dark' ? variables.menuBg : variables.menuLightBg
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -64,8 +70,8 @@ const getLogoTextColor = computed(() => {
|
|
|
|
|
|
|
|
.sidebar-logo-container {
|
|
.sidebar-logo-container {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
- height: 50px;
|
|
|
|
|
- line-height: 50px;
|
|
|
|
|
|
|
+ height: 56px;
|
|
|
|
|
+ line-height: 56px;
|
|
|
background: v-bind(getLogoBackground);
|
|
background: v-bind(getLogoBackground);
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
@@ -73,29 +79,45 @@ const getLogoTextColor = computed(() => {
|
|
|
& .sidebar-logo-link {
|
|
& .sidebar-logo-link {
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ padding: 0 16px;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ line-height: 1;
|
|
|
|
|
|
|
|
& .sidebar-logo {
|
|
& .sidebar-logo {
|
|
|
- width: 32px;
|
|
|
|
|
- height: 32px;
|
|
|
|
|
- vertical-align: middle;
|
|
|
|
|
- margin-right: 12px;
|
|
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ width: 28px;
|
|
|
|
|
+ height: 28px;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ object-fit: contain;
|
|
|
|
|
+ transform: translateY(15px);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
& .sidebar-title {
|
|
& .sidebar-title {
|
|
|
- display: inline-block;
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- color: v-bind(getLogoTextColor);
|
|
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ margin: 0 0 0 10px;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ color: #ffffff !important;
|
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
|
- line-height: 50px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
|
|
+ font-size: 15px;
|
|
|
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
|
|
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
|
|
|
- vertical-align: middle;
|
|
|
|
|
|
|
+ line-height: 28px;
|
|
|
|
|
+ transform: translate(15px, -10px);
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&.collapse {
|
|
&.collapse {
|
|
|
- .sidebar-logo {
|
|
|
|
|
- margin-right: 0px;
|
|
|
|
|
|
|
+ .sidebar-logo-link {
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ .sidebar-title {
|
|
|
|
|
+ display: none;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|