标准版政企呼叫中心业务系统

Logo.vue 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div
  3. class="sidebar-logo-container"
  4. :class="{ collapse: collapse }"
  5. :style="{
  6. backgroundColor:
  7. sideTheme === 'theme-dark'
  8. ? variables.menuBackground
  9. : variables.menuLightBackground
  10. }"
  11. >
  12. <transition name="sidebarLogoFade">
  13. <div>
  14. <router-link
  15. v-if="collapse"
  16. key="collapse"
  17. class="sidebar-logo-link"
  18. to="/"
  19. >
  20. <img v-if="logo" :src="logo" class="sidebar-logo" />
  21. <!-- <h1
  22. v-else
  23. class="sidebar-title"
  24. :style="{
  25. color:
  26. sideTheme === 'theme-dark'
  27. ? variables.logoTitleColor
  28. : variables.logoLightTitleColor
  29. }"
  30. >
  31. {{ title }}
  32. </h1> -->
  33. </router-link>
  34. <router-link v-else key="expand" class="sidebar-logo-link" to="/" style="display: flex;">
  35. <img v-if="logo" :src="logo" class="sidebar-logo" style="margin: 9px 12px;" />
  36. <h1
  37. class="sidebar-title"
  38. :style="{
  39. color:
  40. sideTheme === 'theme-dark'
  41. ? variables.logoTitleColor
  42. : variables.logoLightTitleColor
  43. }"
  44. >
  45. {{ title }}
  46. </h1>
  47. </router-link>
  48. </div>
  49. </transition>
  50. </div>
  51. </template>
  52. <script setup>
  53. import variables from '@/assets/styles/variables.module.scss'
  54. import logo from '@/assets/logo/logo.png'
  55. import useSettingsStore from '@/store/modules/settings'
  56. defineProps({
  57. collapse: {
  58. type: Boolean,
  59. required: true
  60. }
  61. })
  62. const title = ref('12356心理援助热线')
  63. const settingsStore = useSettingsStore()
  64. const sideTheme = computed(() => settingsStore.sideTheme)
  65. </script>
  66. <style lang="scss" scoped>
  67. .sidebarLogoFade-enter-active {
  68. transition: opacity 1.5s;
  69. }
  70. .sidebarLogoFade-enter,
  71. .sidebarLogoFade-leave-to {
  72. opacity: 0;
  73. }
  74. .sidebar-logo-container {
  75. position: relative;
  76. width: 100%;
  77. height: 50px;
  78. line-height: 50px;
  79. background: #2b2f3a;
  80. text-align: center;
  81. overflow: hidden;
  82. & .sidebar-logo-link {
  83. height: 100%;
  84. width: 100%;
  85. & .sidebar-logo {
  86. height: 32px;
  87. vertical-align: middle;
  88. margin-right: 12px;
  89. }
  90. & .sidebar-title {
  91. display: inline-block;
  92. margin: 0;
  93. color: #fff;
  94. font-weight: 600;
  95. line-height: 50px;
  96. font-size: 14px;
  97. font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
  98. vertical-align: middle;
  99. }
  100. }
  101. &.collapse {
  102. .sidebar-logo {
  103. margin-right: 0px;
  104. }
  105. }
  106. }
  107. </style>