Logo.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div
  3. class="sidebar-logo-container"
  4. :class="{ collapse: collapse }"
  5. :style="{
  6. backgroundColor:
  7. sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg,
  8. }"
  9. >
  10. <transition name="sidebarLogoFade">
  11. <router-link
  12. v-if="collapse"
  13. key="collapse"
  14. class="sidebar-logo-link"
  15. to="/"
  16. >
  17. <!-- 途宝-->
  18. <img :src="logo" class="sidebar-logo-mini" />
  19. <!-- <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.sidebarTitle : variables.sidebarLightTitle }">{{ title }} </h1> -->
  20. </router-link>
  21. <router-link v-else key="expand" class="sidebar-logo-link" to="/">
  22. <!-- 途宝-->
  23. <img :src="logo" class="sidebar-logo" />
  24. <div style="float: right;background-color: #fff" class="other" v-if="company === ''"></div>
  25. <!-- <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.sidebarTitle : variables.sidebarLightTitle }">{{ title }} </h1> -->
  26. </router-link>
  27. </transition>
  28. </div>
  29. </template>
  30. <script>
  31. import logoImg from "@/assets/logo/logo.png";
  32. import overseas from "@/assets/logo/hwc.png";
  33. import haituling from "@/assets/logo/haituling.png";
  34. import had from "@/assets/logo/had.jpg";
  35. import overseasZjxd from "@/assets/logo/zjxd.png";
  36. import variables from "@/assets/styles/variables.scss";
  37. import Cookies from "js-cookie";
  38. import testLogo from "@/assets/logo/testLogo.png";
  39. export default {
  40. name: "SidebarLogo",
  41. props: {
  42. collapse: {
  43. type: Boolean,
  44. required: true,
  45. },
  46. },
  47. computed: {
  48. variables() {
  49. return variables;
  50. },
  51. sideTheme() {
  52. return this.$store.state.settings.sideTheme;
  53. },
  54. },
  55. data() {
  56. return {
  57. title: "途宝智慧云仓平台",
  58. logo: logoImg,
  59. company: '',
  60. sysType: "",
  61. };
  62. },
  63. mounted() {
  64. this.company = Cookies.get("companyName")
  65. this.sysType = Cookies.get("sysType");
  66. console.log(Cookies.get("companyName"))
  67. console.log(Cookies.get("sysType"))
  68. if (Cookies.get("test") == 0) {
  69. this.logo = testLogo;
  70. }else if (Cookies.get("test") == 1) {
  71. this.logo = logoImg;
  72. }else if (Cookies.get("test") == 2) {
  73. this.logo = overseas
  74. }else if (Cookies.get("test") == 3) {
  75. this.logo = overseasZjxd
  76. }else if (Cookies.get("test") == 4) {
  77. this.logo = had
  78. }
  79. },
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. .sidebarLogoFade-enter-active {
  84. transition: opacity 1.5s;
  85. }
  86. .sidebarLogoFade-enter,
  87. .sidebarLogoFade-leave-to {
  88. opacity: 0;
  89. }
  90. .sidebar-logo-container {
  91. position: relative;
  92. // width: 100%;
  93. height: 60px;
  94. line-height: 60px;
  95. background: #014da1 !important;
  96. text-align: center;
  97. overflow: hidden;
  98. & .sidebar-logo-link {
  99. height: 100%;
  100. width: 100%;
  101. & .sidebar-logo {
  102. height: 60px;
  103. vertical-align: middle;
  104. margin-right: 12px;
  105. }
  106. & .sidebar-logo-mini {
  107. width: 50px;
  108. vertical-align: middle;
  109. margin: auto;
  110. }
  111. & .sidebar-title {
  112. display: inline-block;
  113. margin: 0;
  114. color: #fff;
  115. font-weight: 600;
  116. line-height: 50px;
  117. font-size: 14px;
  118. font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
  119. vertical-align: middle;
  120. }
  121. }
  122. &.collapse {
  123. .sidebar-logo {
  124. margin-right: 0px;
  125. }
  126. }
  127. }
  128. .other {
  129. width: 0;
  130. height: 0;
  131. border-bottom: 60px solid #014da1;
  132. border-left: 40px solid transparent;
  133. }
  134. </style>