cwg-pc-header.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <header class="cwg-pc-header">
  3. <div class="left">
  4. <cwg-icon :name="!sidebarVisible ? 'crm-bars-staggered' : 'cwg-close'" color="#141d22"
  5. @click="openLeftDrawer" />
  6. </div>
  7. <div class="left">
  8. <image class="left-img" src="/static/images/logo.png" mode="widthFix" alt="logo" />
  9. </div>
  10. <div class="right">
  11. <cwg-system />
  12. <cwg-notice />
  13. <cwg-right-drawer />
  14. </div>
  15. </header>
  16. </template>
  17. <script setup lang="ts">
  18. const props = defineProps({
  19. sidebarVisible: {
  20. type: Boolean,
  21. default: false
  22. },
  23. })
  24. const emit = defineEmits<{
  25. (e: 'open-right-drawer'): void,
  26. (e: 'open-left-drawer'): void
  27. }>()
  28. function openLeftDrawer() {
  29. emit('open-left-drawer');
  30. }
  31. </script>
  32. <style scoped lang="scss">
  33. .cwg-pc-header {
  34. display: flex;
  35. align-items: center;
  36. justify-content: space-between;
  37. width: 100vw;
  38. height: px2rpx(55);
  39. background-color: rgba(255, 255, 255, 0.9);
  40. border-bottom: 1px solid #f0f0f0;
  41. padding: 0 px2rpx(16);
  42. box-sizing: border-box;
  43. position: fixed;
  44. top: 0;
  45. left: 0;
  46. z-index: 101;
  47. }
  48. .left {
  49. display: flex;
  50. align-items: center;
  51. }
  52. .back-arrow {
  53. color: #e74c3c;
  54. font-size: 22px;
  55. cursor: pointer;
  56. margin-right: 16px;
  57. }
  58. .center {
  59. flex: 1;
  60. }
  61. .right {
  62. display: flex;
  63. align-items: center;
  64. }
  65. .bell .dot {
  66. position: absolute;
  67. top: 0;
  68. right: -2px;
  69. width: 7px;
  70. height: 7px;
  71. background: #27ae60;
  72. border-radius: 50%;
  73. display: inline-block;
  74. }
  75. .left-img {
  76. width: px2rpx(120);
  77. }
  78. .avatar .img {
  79. width: 32px;
  80. height: 32px;
  81. border-radius: 50%;
  82. background: #eee;
  83. }
  84. .logo .img {
  85. width: 36px;
  86. height: 36px;
  87. border-radius: 50%;
  88. background: #fff;
  89. }
  90. </style>