消毒机前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="setting_contaienr">
  3. <div class="left_container">
  4. <div class="tab_wrap" @click="changeActiveTab(1)">
  5. <p class="active_line" v-show="activeTab == 1"></p>
  6. <p :class="activeTab == 1 ? 'title active' : 'title'">设备参数配置</p>
  7. <div :class="activeTab == 1 ? 'btn style-btn' : 'dis_btn'">配置</div>
  8. </div>
  9. <div class="tab_wrap" @click="changeActiveTab(2)">
  10. <p class="active_line" v-show="activeTab == 2"></p>
  11. <p :class="activeTab == 2 ? 'title active' : 'title'">修改管理员密码</p>
  12. <div :class="activeTab == 2 ? 'btn style-btn' : 'dis_btn'">修改</div>
  13. </div>
  14. <div class="tab_wrap" @click="changeActiveTab(3)">
  15. <p class="active_line" v-show="activeTab == 3"></p>
  16. <p :class="activeTab == 3 ? 'title active' : 'title'">用户管理</p>
  17. <div :class="activeTab == 3 ? 'btn style-btn' : 'dis_btn'">管理</div>
  18. </div>
  19. <div class="tab_wrap" @click="changeActiveTab(4)">
  20. <p class="active_line" v-show="activeTab == 4"></p>
  21. <p :class="activeTab == 4 ? 'title active' : 'title'">日期/时间设置</p>
  22. <div :class="activeTab == 4 ? 'btn style-btn' : 'dis_btn'">配置</div>
  23. </div>
  24. </div>
  25. <div class="right_container">
  26. <Admin v-if="activeTab == 2" />
  27. <Date v-if="activeTab == 4" />
  28. <Device v-if="activeTab == 1" />
  29. <User v-if="activeTab == 3" />
  30. </div>
  31. </div>
  32. </template>
  33. <script setup>
  34. import { ref } from 'vue'
  35. import Admin from './components/Admin.vue'
  36. import Date from './components/Date.vue'
  37. import Device from './components/Device.vue'
  38. import User from './components/User.vue'
  39. import { getAllUserJSON } from '@/mock/command'
  40. import { useWebSocketStore } from '@/store'
  41. const webSocketStore = useWebSocketStore()
  42. const activeTab = ref(1)
  43. const changeActiveTab = index => {
  44. activeTab.value = index
  45. if (index == 3) {
  46. webSocketStore.sendCommandMsg(getAllUserJSON)
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .setting_contaienr {
  52. display: flex;
  53. align-items: center;
  54. margin-bottom: 19px;
  55. height: 580px;
  56. box-sizing: border-box;
  57. .left_container {
  58. height: 580px;
  59. width: 424px;
  60. margin-right: 30px;
  61. box-sizing: border-box;
  62. border-radius: 16px;
  63. background: #ffffff;
  64. padding: 20px;
  65. padding-bottom: 180px;
  66. display: grid;
  67. grid-template-columns: repeat(1, 1fr);
  68. grid-template-rows: repeat(4, 1fr);
  69. row-gap: 20px;
  70. .tab_wrap {
  71. width: 384px;
  72. height: 80px;
  73. border-radius: 14px;
  74. background: #f6f6f6;
  75. box-sizing: border-box;
  76. display: flex;
  77. align-items: center;
  78. justify-content: space-between;
  79. padding: 0 18px;
  80. padding-left: 37px;
  81. position: relative;
  82. .title {
  83. font-family: Zona Pro;
  84. font-size: 18px;
  85. font-weight: normal;
  86. letter-spacing: 0.06em;
  87. color: #000000;
  88. }
  89. .active {
  90. color: #06518b;
  91. }
  92. .btn {
  93. width: 87px;
  94. height: 45px;
  95. border-radius: 23px;
  96. background: #06518b;
  97. display: flex;
  98. align-items: center;
  99. justify-content: center;
  100. font-family: Source Han Sans CN;
  101. font-size: 14px;
  102. font-weight: normal;
  103. letter-spacing: 0.1em;
  104. color: #ffffff;
  105. }
  106. .dis_btn {
  107. width: 87px;
  108. height: 45px;
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. font-family: Source Han Sans CN;
  113. font-size: 14px;
  114. font-weight: normal;
  115. line-height: normal;
  116. letter-spacing: 0.1em;
  117. color: #06518b;
  118. }
  119. .active_line {
  120. position: absolute;
  121. left: 20px;
  122. top: 24px;
  123. width: 4px;
  124. height: 32px;
  125. border-radius: 2px;
  126. background: #06518b;
  127. }
  128. }
  129. }
  130. .right_container {
  131. height: 580px;
  132. flex: 1;
  133. box-sizing: border-box;
  134. border-radius: 16px;
  135. background: #ffffff;
  136. overflow: hidden;
  137. }
  138. }
  139. </style>