index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <div class="query-box">
  3. <div class="query-head">
  4. <div class="query-tbas">
  5. <div class="tbas-title" :class="activeKey == '1' ? 'active' : ''" @click="activeclick('1')">对象设置</div>
  6. <a-divider type="vertical" style="height: 15px; background-color: #f4f5f7; margin: 8px 20px" />
  7. <div class="tbas-title" :class="activeKey == '2' ? 'active' : ''" @click="activeclick('2')">维修记录</div>
  8. <a-divider type="vertical" style="height: 15px; background-color: #f4f5f7; margin: 8px 20px" />
  9. <div class="tbas-title" :class="activeKey == '3' ? 'active' : ''" @click="activeclick('3')">报废记录</div>
  10. </div>
  11. </div>
  12. <div class="query-body">
  13. <Setup ref="setupRef" v-if="activeKey == '1'" />
  14. <Upkeep ref="upkeepRef" v-if="activeKey == '2'" />
  15. <Scrap ref="scraplRef" v-if="activeKey == '3'" />
  16. </div>
  17. </div>
  18. </template>
  19. <script setup>
  20. import Setup from './setup.vue'
  21. import Upkeep from './upkeep.vue'
  22. import Scrap from './scrap.vue'
  23. const activeKey = ref('1')
  24. const setupRef = ref(null)
  25. const upkeepRef = ref(null)
  26. const scraplRef = ref(null)
  27. onMounted(() => {})
  28. onBeforeMount(() => {})
  29. // 点击标签
  30. const activeclick = (v) => {
  31. activeKey.value = v
  32. }
  33. </script>
  34. <style lang="less" scoped>
  35. .query-box {
  36. width: 100%;
  37. background-color: #fff;
  38. // 顶部
  39. .query-head {
  40. width: 100%;
  41. height: 50px;
  42. display: flex;
  43. justify-content: space-between;
  44. padding: 15px;
  45. border-bottom: 1px solid #e7e7e7;
  46. .query-tbas {
  47. width: 95%;
  48. display: flex;
  49. .tbas-title {
  50. height: 35px;
  51. line-height: 25px;
  52. color: #a7a7a7;
  53. font-size: 16px;
  54. cursor: pointer;
  55. }
  56. .active {
  57. color: #1b8fff;
  58. border-bottom: 2px solid #1b8fff;
  59. }
  60. }
  61. }
  62. }
  63. </style>