shuizhi.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <script setup>
  2. import { ref } from "vue";
  3. import jsBox from "./jsBox.vue";
  4. import csBox from "./csBox.vue";
  5. const index = ref(0)
  6. const changeTab = (i) => {
  7. index.value = i
  8. }
  9. defineProps({
  10. screenData: {
  11. type: Object,
  12. default: []
  13. },
  14. })
  15. </script>
  16. <template>
  17. <div class="home-box shuizhi">
  18. <div class="home-box-top">
  19. <div class="title">水质分析</div>
  20. <div class="right">
  21. <span :class="['btn', index == 0 ? 'action' : '']" @click="changeTab(0)">进水</span>
  22. <span :class="['btn', index == 1 ? 'action' : '']" @click="changeTab(1)">出水</span>
  23. </div>
  24. </div>
  25. <div class="main">
  26. <jsBox :screenData="screenData" v-if="index == 0"></jsBox>
  27. <csBox :screenData="screenData" v-else="index == 1"></csBox>
  28. </div>
  29. </div>
  30. </template>
  31. <style scoped lang="scss">
  32. .shuizhi {
  33. .right {
  34. .btn {
  35. width: 6.2rem;
  36. height: 2.8rem;
  37. background: rgba(238, 249, 255, 1);
  38. border: 0.1rem solid rgba(122, 215, 249, 1);
  39. float: left;
  40. border-radius: 0;
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. cursor: pointer;
  45. color: rgba(84, 194, 248, 1);
  46. &:first-child {
  47. border-right: 0;
  48. border-top-left-radius: 0.4rem;
  49. border-bottom-left-radius: 0.4rem;
  50. }
  51. &:last-child {
  52. border-left: 0;
  53. border-top-right-radius: 0.4rem;
  54. border-bottom-right-radius: 0.4rem;
  55. }
  56. }
  57. .action,
  58. .btn:hover {
  59. background: linear-gradient(270deg, #59CCFA 0%, #3C97F7 100%);
  60. border: none;
  61. color: #fff;
  62. }
  63. }
  64. :deep(.main) {
  65. padding: 1.8rem 1.8rem 1.6rem;
  66. .box-wrap {
  67. display: grid;
  68. grid-template-columns: repeat(3, 1fr);
  69. grid-gap: 1rem 6rem;
  70. }
  71. .box-item {
  72. height: 10.8rem;
  73. display: flex;
  74. align-items: center;
  75. flex-direction: column;
  76. .cicle {
  77. height: 5.2rem;
  78. margin-bottom: 1rem;
  79. }
  80. .name {
  81. color: #0A284E;
  82. font-size: 1.4rem;
  83. line-height: 2rem;
  84. margin-bottom: 0.2rem;
  85. font-weight: bold;
  86. }
  87. .value {
  88. font-size: 1.2rem;
  89. line-height: 1.8rem;
  90. color: #466993;
  91. }
  92. }
  93. }
  94. }
  95. </style>