fnHeader.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div class="header">
  3. <div class="title">
  4. <img class="logo" src="@/assets/images/common/logo.png" alt="" />
  5. <span>飞鸟后台管理系统</span>
  6. <!-- <img class="logo-icon" src="@/assets/images/common/logo-icon.png" alt="" /> -->
  7. </div>
  8. <div class="path-btn">
  9. <router-link to="/layout/home" class="nav-item" :class="{ active: isTreeActive }"> 果树管理 </router-link>
  10. <router-link to="/layout/user" class="nav-item" :class="{ active: isUserActive }"> 用户管理 </router-link>
  11. </div>
  12. </div>
  13. <!-- 四个方向的阴影 -->
  14. <div class="page-shadow" v-show="!hideShadow">
  15. <div class="page-bg bg-top"></div>
  16. <div class="page-bg bg-right"></div>
  17. <div class="page-bg bg-bottom"></div>
  18. <div class="page-bg bg-left"></div>
  19. </div>
  20. </template>
  21. <script setup>
  22. import { onMounted, computed, ref } from "vue";
  23. import { useRoute } from "vue-router";
  24. const route = useRoute();
  25. const props = defineProps({
  26. hideShadow: {
  27. type: Boolean,
  28. defalut: false,
  29. },
  30. });
  31. const activeNav = computed(() => {
  32. return route.meta.nav;
  33. });
  34. const isTreeActive = computed(() => {
  35. return activeNav.value === "tree";
  36. });
  37. const isUserActive = computed(() => {
  38. return activeNav.value === "user";
  39. });
  40. const userInfo = JSON.parse(sessionStorage.getItem("userinfo"));
  41. </script>
  42. <style lang="scss" scoped>
  43. .header {
  44. width: 100%;
  45. height: 76px;
  46. display: flex;
  47. justify-content: space-between;
  48. box-sizing: border-box;
  49. pointer-events: all;
  50. position: relative;
  51. color: #2199f8;
  52. background: #fff;
  53. &::after {
  54. content: "";
  55. position: absolute;
  56. left: 0;
  57. bottom: 0;
  58. width: 100%;
  59. height: 10px;
  60. z-index: 1;
  61. box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1);
  62. }
  63. .title {
  64. width: 100%;
  65. height: 100%;
  66. font-size: 24px;
  67. letter-spacing: 2px;
  68. padding-left: 20px;
  69. display: flex;
  70. align-items: center;
  71. box-sizing: border-box;
  72. // background: url("@/assets/images/common/header-bg.png") no-repeat center center / 100% 100%;
  73. box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1);
  74. .logo {
  75. width: 23px;
  76. height: 26px;
  77. }
  78. .logo-icon {
  79. width: 33px;
  80. height: 12px;
  81. }
  82. span {
  83. margin: 0 5px;
  84. cursor: pointer;
  85. font-family: "PangMenZhengDao";
  86. }
  87. }
  88. .path-btn {
  89. ::v-deep {
  90. .router-link-active {
  91. color: yellow;
  92. }
  93. }
  94. }
  95. .focus-farm {
  96. position: absolute;
  97. right: 192px;
  98. top: 23px;
  99. ::v-deep {
  100. .el-select__wrapper {
  101. background: rgba(255, 212, 137, 0.2);
  102. box-shadow: 0 0 0 1px rgba(255, 212, 137, 0.3) inset;
  103. height: 50px;
  104. line-height: 50px;
  105. .el-select__caret {
  106. color: #ffd489;
  107. }
  108. }
  109. .el-select__placeholder {
  110. color: #f7be5a;
  111. font-size: 20px;
  112. font-family: "PangMenZhengDao";
  113. text-align: center;
  114. }
  115. }
  116. }
  117. .date {
  118. display: flex;
  119. align-items: center;
  120. position: absolute;
  121. right: 30px;
  122. top: 24px;
  123. .time {
  124. margin-left: 14px;
  125. line-height: 18px;
  126. div {
  127. font-family: "PangMenZhengDao";
  128. letter-spacing: 1px;
  129. font-size: 16px;
  130. }
  131. span {
  132. font-size: 11px;
  133. font-family: "SOURCEHANTIFINE";
  134. }
  135. }
  136. }
  137. }
  138. // 阴影样式
  139. .page-bg {
  140. position: fixed;
  141. z-index: -1;
  142. }
  143. .bg-top {
  144. top: 0;
  145. width: 100%;
  146. height: 200px;
  147. background: linear-gradient(0deg, rgba(0, 21, 31, 0), #00151f);
  148. }
  149. .bg-right {
  150. right: 0;
  151. width: 600px;
  152. height: 100%;
  153. background: linear-gradient(90deg, rgba(0, 21, 31, 0), rgb(0, 21, 31, 0.7));
  154. }
  155. .bg-bottom {
  156. bottom: 0;
  157. width: 100%;
  158. height: 200px;
  159. background: linear-gradient(180deg, rgba(0, 21, 31, 0), rgb(0, 21, 31, 0.7));
  160. }
  161. .bg-left {
  162. left: 0;
  163. width: 600px;
  164. height: 100%;
  165. background: linear-gradient(270deg, rgba(0, 21, 31, 0), rgb(0, 21, 31, 0.7));
  166. }
  167. </style>
  168. <style lang="less">
  169. .focus-farm-select {
  170. &.el-popper.is-light {
  171. background: #232323;
  172. border-color: rgba(255, 212, 137, 0.3);
  173. box-shadow: 0px 0px 12px rgba(255, 212, 137, 0.3);
  174. .el-select-dropdown__item {
  175. background: none;
  176. color: rgba(255, 212, 137, 0.6);
  177. }
  178. .el-select-dropdown__item.is-selected {
  179. background: rgba(255, 212, 137, 0.2);
  180. color: #ffd489;
  181. }
  182. }
  183. &.el-popper.is-light .el-popper__arrow:before {
  184. background: #232323;
  185. border-color: rgba(255, 212, 137, 0.3);
  186. }
  187. }
  188. </style>