Health.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div class="health">
  3. <div class="selections mg-b-16">
  4. <div
  5. class="item"
  6. @click="tabSelect(0)"
  7. :class="{ active: tabIndex == 0 }"
  8. >
  9. 未确认缺陷
  10. </div>
  11. <div
  12. class="item"
  13. @click="tabSelect(1)"
  14. :class="{ active: tabIndex == 1 }"
  15. >
  16. 已确认缺陷
  17. </div>
  18. <!-- <div
  19. class="item"
  20. @click="tabSelect(2)"
  21. :class="{ active: tabIndex == 2 }"
  22. >
  23. 已分配任务
  24. </div>
  25. <div
  26. class="item"
  27. @click="tabSelect(3)"
  28. :class="{ active: tabIndex == 3 }"
  29. >
  30. 已完成任务
  31. </div> -->
  32. </div>
  33. <div v-if="tabIndex == 0">
  34. <health-tab-1 />
  35. </div>
  36. <div v-if="tabIndex == 1">
  37. <health-tab-2 />
  38. </div>
  39. <div v-if="tabIndex == 2">
  40. <health-tab-3 />
  41. <!-- <button class="btn" @click="dialogVisible = true">点击弹窗</button>
  42. <el-dialog title="日信息对比" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal" :close-on-click-modal="false">
  43. <dayinfo />
  44. </el-dialog> -->
  45. </div>
  46. <div v-if="tabIndex == 3">
  47. <health-tab-4 />
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. import HealthTab1 from "./HealthTab1.vue";
  53. import HealthTab2 from "./HealthTab2.vue";
  54. import HealthTab3 from "./HealthTab3.vue";
  55. import HealthTab4 from "./HealthTab4.vue";
  56. export default {
  57. setup() {},
  58. components: { HealthTab1, HealthTab2, HealthTab3, HealthTab4 },
  59. data() {
  60. return {
  61. tabIndex: 0,
  62. };
  63. },
  64. created() {
  65. this.tabIndex = this.$route.query.tab ? parseInt(this.$route.query.tab) : 0;
  66. },
  67. methods: {
  68. tabSelect(state) {
  69. this.tabIndex = state;
  70. },
  71. },
  72. };
  73. </script>
  74. <style lang="less" scope>
  75. .health {
  76. .selections {
  77. display: flex;
  78. .item {
  79. flex: 0 0 128px;
  80. text-align: center;
  81. line-height: 33px;
  82. margin-right: 8px;
  83. color: @font-color;
  84. font-size: @fontsize-s;
  85. background: fade(@gray, 20);
  86. border: 1px solid fade(@gray, 20);
  87. &:hover,
  88. &.active {
  89. background: fade(@green, 20);
  90. border: 1px solid @green;
  91. color: @green;
  92. cursor: pointer;
  93. }
  94. }
  95. }
  96. }
  97. </style>