index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <div class="windAndPhotovoltaic">
  3. <div class="wp-search">
  4. <div class="tabCut">
  5. <div
  6. @click="tabClick(val.id)"
  7. :class="[
  8. tabIndex === val.id ? 'active' : '',
  9. displayDetail ? 'disabled' : '',
  10. ]"
  11. v-for="val in tabOptions"
  12. :key="val.id"
  13. >
  14. <span>{{ val.name }}</span>
  15. </div>
  16. </div>
  17. <el-date-picker
  18. size="mini"
  19. type="date"
  20. v-model="date"
  21. value-format="YYYY-MM-DD"
  22. placeholder="请选择"
  23. style="margin-left: 15px"
  24. popper-class="date-select"
  25. >
  26. </el-date-picker>
  27. <el-button round size="mini" class="searchColor" @click="getDatas"
  28. >搜 索</el-button
  29. >
  30. </div>
  31. <div class="wp-content">
  32. <div class="leftContent">
  33. <span>{{ selectValue }}</span>
  34. </div>
  35. <div class="wp-body">
  36. <Wind v-if="tabIndex == -1" :date="date" ref="wind" />
  37. <Photovoltaic v-if="tabIndex == -2" :date="date" ref="voltaic" />
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import Wind from "@/views/economicsOperation/stationAnalyse/windAndPhotovoltaic/components/wind.vue";
  44. import Photovoltaic from "@/views/economicsOperation/stationAnalyse/windAndPhotovoltaic/components/photovoltaic.vue";
  45. import dayjs from "dayjs";
  46. export default {
  47. name: "WindAndPhotovoltaic", //风光资源分析
  48. components: { Wind, Photovoltaic },
  49. data() {
  50. return {
  51. station: "",
  52. stationOptions: [],
  53. date: dayjs().add(-1, "day").format("YYYY-MM-DD"),
  54. tabIndex: -1,
  55. tabOptions: [
  56. { id: -1, name: "风电" },
  57. { id: -2, name: "光伏" },
  58. ],
  59. };
  60. },
  61. mounted() {},
  62. computed: {
  63. selectValue() {
  64. return this.tabIndex == -1 ? "风资源分析" : "光资源分析";
  65. },
  66. },
  67. methods: {
  68. tabClick(tab) {
  69. this.tabIndex = tab;
  70. this.selectValue = tab == -1 ? "风资源分析" : "光资源分析";
  71. },
  72. getDatas() {
  73. if (this.tabIndex == -1) {
  74. this.$refs.wind.getData(true);
  75. } else {
  76. this.$refs.voltaic.getData();
  77. }
  78. },
  79. },
  80. };
  81. </script>
  82. <style lang="less" scoped>
  83. .windAndPhotovoltaic {
  84. height: 100%;
  85. width: 100%;
  86. padding: 0 20px;
  87. .wp-search {
  88. padding: 10px 0;
  89. .tabCut {
  90. display: inline-block;
  91. div {
  92. display: inline-block;
  93. width: 60px;
  94. height: 27px;
  95. border: 1px solid #274934;
  96. text-align: center;
  97. line-height: 25px;
  98. cursor: pointer;
  99. }
  100. div:nth-child(1) {
  101. border-radius: 13px 0px 0px 13px;
  102. border-right-width: 0;
  103. }
  104. div:nth-child(2) {
  105. border-radius: 0px 13px 13px 0px;
  106. }
  107. .active {
  108. background-color: rgba(5, 187, 76, 0.9);
  109. color: #fff;
  110. }
  111. .disabled {
  112. cursor: not-allowed;
  113. pointer-events: none;
  114. }
  115. }
  116. button {
  117. margin-left: 10px;
  118. background: rgba(67, 81, 107, 0.3);
  119. border: 1px solid #274934;
  120. color: #b3b3b3;
  121. }
  122. .searchColor {
  123. background-color: rgba(5, 187, 76, 0.2);
  124. border: 1px solid #3b6c53;
  125. color: #b3b3b3;
  126. font-size: 14px;
  127. &:hover {
  128. background-color: rgba(5, 187, 76, 0.5);
  129. color: #ffffff;
  130. }
  131. }
  132. }
  133. .wp-content {
  134. height: calc(100% - 40px);
  135. padding-bottom: 10px;
  136. .leftContent {
  137. width: 242px;
  138. height: 45px;
  139. line-height: 45px;
  140. background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
  141. span {
  142. font-size: 16px;
  143. font-family: Microsoft YaHei;
  144. font-weight: 400;
  145. color: #05bb4c;
  146. margin-left: 25px;
  147. }
  148. }
  149. .wp-body {
  150. height: calc(100% - 36px);
  151. }
  152. }
  153. }
  154. </style>