basePoints.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <BasePoint
  3. v-for="point in basePoints"
  4. :key="point.id"
  5. :pos="point.pos"
  6. @change-pos="(pos) => (point.pos = pos)"
  7. :active="customMap.activeBasePoint === point"
  8. @blur="
  9. () =>
  10. (customMap.activeBasePoint =
  11. customMap.activeBasePoint === point ? null : customMap.activeBasePoint)
  12. "
  13. @focus="() => (customMap.activeBasePoint = point)"
  14. />
  15. <!-- <ActionsPanel :menus="activeActionMenus" v-if="active" />-->
  16. <div ref="menu" @touchstart.stop class="action-menus" v-if="!trackBaseIng">
  17. <ActionMenus
  18. v-if="drawstatus !== DrawStatus.ing && customMap.activeBasePoint"
  19. :menus="activeActionMenus"
  20. :active-key="customMap.activeBasePoint"
  21. dire="row"
  22. />
  23. </div>
  24. </template>
  25. <script setup lang="ts">
  26. import { basePoints } from "@/store/basePoint";
  27. import BasePoint from "./basePoint.vue";
  28. import { customMap, useSDK } from "@/hook";
  29. import ActionMenus from "@/components/group-button/index.vue";
  30. import { DrawStatus, drawstatus, trackBaseIng } from "../fixManage";
  31. const activeActionMenus = [
  32. {
  33. key: "delete",
  34. icon: "del",
  35. text: "删除",
  36. color: "#FF4D4F",
  37. iconColor: "#fff",
  38. onClick() {
  39. const index = basePoints.value.indexOf(customMap.activeBasePoint);
  40. console.log(index);
  41. if (~index) {
  42. basePoints.value.splice(index, 1);
  43. customMap.activeBasePoint = null;
  44. }
  45. },
  46. },
  47. ];
  48. </script>
  49. <style scoped lang="scss">
  50. .action-menus {
  51. position: absolute;
  52. bottom: var(--boundMargin);
  53. left: 50%;
  54. transform: translateX(-50%);
  55. display: flex;
  56. z-index: 2;
  57. .menus {
  58. position: static;
  59. }
  60. }
  61. </style>