floor-tab.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div class="floor-btn">
  3. <div v-for="item in floorList" :key="item.key" :class="['quisk-item', item.key == nowSelect ? 'active' : '']" @click="floor(item.key)">
  4. <span>{{ item.text }}</span>
  5. </div>
  6. </div>
  7. </template>
  8. <script lang="ts" setup>
  9. import { custom } from "@/env";
  10. import { getSupperPanoModel } from "@/sdk/association";
  11. import { currentModel, fuseModel } from "@/model";
  12. import { flyModel } from "@/hook/use-fly";
  13. import { ref } from "vue";
  14. import { SDK, sdk as _sdk } from "@/sdk";
  15. const nowSelect = ref('all');
  16. const floorList = [{
  17. key: "all",
  18. text: "全部"
  19. },{
  20. key: 0,
  21. text: "1楼"
  22. },{
  23. key: 1,
  24. text: "2楼"
  25. },{
  26. key: 2,
  27. text: "3楼"
  28. }] as any[];
  29. const floor = (num: any) => {
  30. sdk.goFloor(num);
  31. nowSelect.value = num;
  32. }
  33. </script>
  34. <style lang="scss" scoped>
  35. .floor-btn{
  36. position: absolute;
  37. bottom : calc(var(--editor-menu-bottom, 0px) + 10px);
  38. left : calc(var(--left-pano-left) + var(--left-pano-width));
  39. margin-left : 24px;
  40. display: flex;
  41. flex-direction: column;
  42. align-items: center;
  43. z-index:100;
  44. width: 60px;
  45. height: 176px;
  46. background: rgba(27, 27, 28, 0.8);
  47. border-radius: 20px;
  48. padding: 8px;
  49. transition : all .3s ease;
  50. .active{
  51. background: #00c8af;
  52. }
  53. .quisk-item{
  54. width: 100%;
  55. height: 40px;
  56. border-radius: 10px;
  57. display: flex;
  58. align-items: center;
  59. justify-content: center;
  60. color: #fff;
  61. cursor: pointer;
  62. }
  63. }
  64. </style>