customHeader.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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-green} {
  86. .vent-custom-header {
  87. --image-vent-header1: url('/@/assets/images/themify/green/vent/vent-header1.png');
  88. --image-select-bg: url('/@/assets/images/themify/deepblue/vent/home/select-bg.png');
  89. }
  90. }
  91. @{theme-deepblue} {
  92. .vent-custom-header {
  93. --image-vent-header1: url('/@/assets/images/themify/deepblue/vent/vent-header1.png');
  94. --image-select-bg: url('/@/assets/images/themify/deepblue/vent/home/select-bg.png');
  95. }
  96. }
  97. .vent-custom-header {
  98. --image-vent-header1: url('/@/assets/images/vent/vent-header1.png');
  99. --image-select-bg: url('/@/assets/images/vent/home/select-bg.png');
  100. width: 100%;
  101. position: relative;
  102. z-index: 9999;
  103. pointer-events: none;
  104. .vent-home-header {
  105. width: 100%;
  106. position: fixed;
  107. top: 0;
  108. // background: url('/@/assets/images/vent/new-home/header-bg.png') no-repeat;
  109. // height: 100px;
  110. background: var(--image-vent-header1) no-repeat;
  111. height: 89px;
  112. background-size: contain;
  113. display: flex;
  114. justify-content: center;
  115. .header-icon {
  116. margin-top: 45px;
  117. }
  118. .header-text {
  119. position: fixed;
  120. top: 5px;
  121. color: #fff;
  122. font-size: 32px;
  123. font-family: 'ysbtFont';
  124. background-image: linear-gradient(#ffffff 50%, @vent-base-light-bg);
  125. -webkit-background-clip: text;
  126. color: transparent;
  127. }
  128. }
  129. .container-title {
  130. width: 380px;
  131. height: 34px;
  132. top: 60px;
  133. // background: url('/@/assets/images/vent/new-home/container-title-bg.png') no-repeat;
  134. background: var(--image-select-bg) no-repeat;
  135. background-size: contain;
  136. padding: 0 0 0 40px;
  137. // padding: 0 0 0 180px;
  138. font-size: 20px;
  139. pointer-events: auto;
  140. position: relative;
  141. z-index: 9999;
  142. .title-select {
  143. width: 340px;
  144. position: absolute;
  145. top: 0;
  146. // left: 160px;
  147. }
  148. }
  149. }
  150. :deep(.zxm-select) {
  151. width: 300px;
  152. .@{ventSpace}-select-selector {
  153. background: transparent !important;
  154. border: none !important;
  155. box-shadow: none !important;
  156. .zxm-select-selection-item {
  157. color: #fff !important;
  158. font-size: 20px;
  159. }
  160. }
  161. .@{ventSpace}-select-arrow {
  162. color: #fff !important;
  163. }
  164. }
  165. </style>