index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div class="health">
  3. <div class="selections mg-b-16">
  4. <div class="item" @click="tabSelect(0)" :class="{ active: tabIndex == 0 }">风场功率风速排布图</div>
  5. <div class="item" @click="tabSelect(1)" :class="{ active: tabIndex == 1 }">项目功率风速排布图</div>
  6. <div class="item" @click="tabSelect(2)" :class="{ active: tabIndex == 2 }">线路功率风速排布图</div>
  7. </div>
  8. <div class="curHeight" v-if="tabIndex == 0">
  9. <Tab1 />
  10. </div>
  11. <div class="curHeight" v-if="tabIndex == 1">
  12. <Tab2 />
  13. </div>
  14. <div class="curHeight" v-if="tabIndex == 2">
  15. <Tab3 />
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import Tab1 from "./tab1.vue";
  21. import Tab2 from "./tab2.vue";
  22. import Tab3 from "./tab3.vue";
  23. export default {
  24. // 名称
  25. name: "wtSaturability",
  26. // 使用组件
  27. components: {
  28. Tab1,
  29. Tab2,
  30. Tab3
  31. },
  32. // 数据
  33. data () {
  34. const that = this;
  35. return {
  36. tabIndex: 0,
  37. };
  38. },
  39. // 函数
  40. methods: {
  41. tabSelect (state) {
  42. this.tabIndex = state;
  43. },
  44. // 请求服务
  45. requestData () {
  46. }
  47. },
  48. created () {
  49. this.requestData();
  50. },
  51. mounted () { },
  52. unmounted () { },
  53. };
  54. </script>
  55. <style lang="less" scope>
  56. .health {
  57. .selections {
  58. display: flex;
  59. .item {
  60. flex: 0 0 128px;
  61. text-align: center;
  62. line-height: 33px;
  63. margin-right: 8px;
  64. color: @font-color;
  65. font-size: @fontsize-s;
  66. background: fade(@gray, 20);
  67. border: 1px solid fade(@gray, 20);
  68. &:hover,
  69. &.active {
  70. background: fade(@green, 20);
  71. border: 1px solid @green;
  72. color: @green;
  73. cursor: pointer;
  74. }
  75. }
  76. }
  77. .curHeight {
  78. height: 87vh;
  79. }
  80. }
  81. </style>