customHeader.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <div class="vent-custom-header">
  3. <div class="vent-home-header">
  4. <!-- <Decoration5 class="header-icon" :dur="2" :color="['#21437F', '#2CF7FE']" style="width:500px;height:40px;" /> -->
  5. <div class="header-text"><slot></slot></div>
  6. </div>
  7. <div class="container-title" v-if="fieldNames">
  8. <a-select
  9. class="title-select"
  10. ref="select"
  11. v-model:value="currentTitleValue"
  12. @change="handleTitleChange"
  13. dropdownClassName="drop"
  14. :field-names="fieldNames"
  15. :options="options"
  16. :dropdownStyle="{ background: 'transparent', borderBottom: '1px solid #ececec66', backdropFilter: 'blur(50px)', color: '#fff' }"
  17. >
  18. <!-- <a-select-option value="2">15212工作面</a-select-option>
  19. <a-select-option value="1598491318007898113">采煤工作面</a-select-option>
  20. <a-select-option value="3">掘进工作面</a-select-option> -->
  21. </a-select>
  22. </div>
  23. </div>
  24. </template>
  25. <script lang="ts">
  26. import { defineComponent, computed } from 'vue';
  27. import { Decoration5 } from '@kjgl77/datav-vue3';
  28. export default defineComponent({
  29. name: 'CustomHeader',
  30. components: { Decoration5 },
  31. props: {
  32. optionValue: {
  33. type: String,
  34. },
  35. fieldNames: {
  36. type: Object,
  37. default: () => {},
  38. },
  39. options: {
  40. type: Array,
  41. default: () => [],
  42. },
  43. },
  44. emits: ['change'],
  45. setup(props, { emit }) {
  46. const currentTitleValue = computed(() => props.optionValue);
  47. // 标题选择
  48. function handleTitleChange(value) {
  49. emit('change', value);
  50. }
  51. return {
  52. currentTitleValue,
  53. handleTitleChange,
  54. };
  55. },
  56. });
  57. </script>
  58. <style lang="less">
  59. @import '/@/design/vent/modal.less';
  60. .@{ventSpace}-select-dropdown.drop {
  61. background-color: transparent !important;
  62. .@{ventSpace}-select-item-option-selected,
  63. .@{ventSpace}-select-item-option-active {
  64. background-color: #ffffff33 !important;
  65. }
  66. .@{ventSpace}-select-item {
  67. color: inherit;
  68. &:hover {
  69. background-color: #ffffff33 !important;
  70. }
  71. }
  72. .@{ventSpace}-select-tree {
  73. .@{ventSpace}-select-tree-treenode {
  74. color: inherit;
  75. }
  76. .@{ventSpace}-select-tree-switcher-icon {
  77. color: inherit;
  78. }
  79. }
  80. }
  81. </style>
  82. <style lang="less" scoped>
  83. @import '/@/design/theme.less';
  84. @ventSpace: zxm;
  85. @{theme-deepblue} {
  86. .vent-custom-header {
  87. --image-vent-header1: url('/@/assets/images/themify/deepblue/vent-header1.png');
  88. --image-select-bg: url('/@/assets/images/themify/deepblue/home/select-bg.png');
  89. }
  90. }
  91. .vent-custom-header {
  92. --image-vent-header1: url('/@/assets/images/vent/vent-header1.png');
  93. --image-select-bg: url('/@/assets/images/vent/home/select-bg.png');
  94. width: 100%;
  95. position: relative;
  96. z-index: 9999;
  97. .vent-home-header {
  98. width: 100%;
  99. position: fixed;
  100. top: 0;
  101. // background: url('/@/assets/images/vent/new-home/header-bg.png') no-repeat;
  102. // height: 100px;
  103. background: var(--image-vent-header1) no-repeat;
  104. height: 89px;
  105. background-size: contain;
  106. display: flex;
  107. justify-content: center;
  108. .header-icon {
  109. margin-top: 45px;
  110. }
  111. .header-text {
  112. position: fixed;
  113. top: 5px;
  114. color: #fff;
  115. font-size: 32px;
  116. font-family: 'ysbtFont';
  117. background-image: linear-gradient(#ffffff 50%, @vent-base-light-bg);
  118. -webkit-background-clip: text;
  119. color: transparent;
  120. }
  121. }
  122. .container-title {
  123. width: 380px;
  124. height: 34px;
  125. top: 60px;
  126. // background: url('/@/assets/images/vent/new-home/container-title-bg.png') no-repeat;
  127. background: var(--image-select-bg) no-repeat;
  128. background-size: contain;
  129. padding: 0 0 0 40px;
  130. // padding: 0 0 0 180px;
  131. font-size: 20px;
  132. pointer-events: auto;
  133. position: relative;
  134. z-index: 9999;
  135. .title-select {
  136. width: 340px;
  137. position: absolute;
  138. top: 0;
  139. // left: 160px;
  140. }
  141. }
  142. }
  143. :deep(.zxm-select) {
  144. width: 300px;
  145. .@{ventSpace}-select-selector {
  146. background: transparent !important;
  147. border: none !important;
  148. box-shadow: none !important;
  149. .zxm-select-selection-item {
  150. color: #fff !important;
  151. font-size: 20px;
  152. }
  153. }
  154. .@{ventSpace}-select-arrow {
  155. color: #fff !important;
  156. }
  157. }
  158. </style>