index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. </div>
  9. </div>
  10. <div class="query-body">
  11. <list ref="listRef" v-if="activeKey == '1'" />
  12. <noticelist ref="noticelistRef" v-if="activeKey == '2'" />
  13. </div>
  14. </div>
  15. </template>
  16. <script setup>
  17. import List from './list.vue'
  18. import Noticelist from './noticelist.vue'
  19. const activeKey = ref('1')
  20. const listRef = ref(null)
  21. const noticelistRef = ref(null)
  22. onMounted(() => {})
  23. onBeforeMount(() => {})
  24. // 点击标签
  25. const activeclick = (v) => {
  26. activeKey.value = v
  27. }
  28. </script>
  29. <style lang="less" scoped>
  30. .query-box {
  31. width: 100%;
  32. background-color: #fff;
  33. // 顶部
  34. .query-head {
  35. width: 100%;
  36. height: 50px;
  37. display: flex;
  38. justify-content: space-between;
  39. padding: 15px;
  40. border-bottom: 1px solid #e7e7e7;
  41. .query-tbas {
  42. width: 95%;
  43. display: flex;
  44. .tbas-title {
  45. height: 35px;
  46. line-height: 25px;
  47. color: #a7a7a7;
  48. font-size: 16px;
  49. cursor: pointer;
  50. }
  51. .active {
  52. color: #1b8fff;
  53. border-bottom: 2px solid #1b8fff;
  54. }
  55. }
  56. }
  57. }
  58. </style>