index.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!--
  2. * @Author: tengmingxue 1473375109@qq.com
  3. * @Date: 2024-08-22 19:44:53
  4. * @LastEditors: tengmingxue 1473375109@qq.com
  5. * @LastEditTime: 2024-08-22 20:53:23
  6. * @FilePath: \xld_three_map\src\views\components\LayersTools\index.vue
  7. * @Description: 图层要素工具
  8. -->
  9. <template>
  10. <div class="query-edit-tool-box">
  11. <template v-for="(tool, index) in tools.filter(item => item.show)" :key="index">
  12. <component class="tools-box" :title="tool.name" :is="components[tool.id]" />
  13. </template>
  14. </div>
  15. </template>
  16. <script setup>
  17. import { ref, watch } from "vue";
  18. import EditVector from "./components/EditVector.vue";
  19. import QuerySpace from "./components/QuerySpace.vue";
  20. import LayerModify from "./components/LayerModify.vue";
  21. import {useMapToolsStore} from '/@/store/modules/mapTools';
  22. const mapToolsStore = useMapToolsStore();
  23. const components = {
  24. EditVector,
  25. QuerySpace,
  26. LayerModify,
  27. }
  28. const tools = ref([
  29. { name: "空间查询", id: "QuerySpace", show: false },
  30. { name: "矢量数据维护", id: "EditVector", show: false },
  31. { name: "矢量数据维护", id: "LayerModify", show: mapToolsStore.getLayerToolsShow },
  32. ]);
  33. watch(() => mapToolsStore.getLayerToolsShow, (newVal) => {
  34. tools.value[2].show = newVal;
  35. });
  36. </script>
  37. <style lang="less" scoped>
  38. .query-edit-tool-box {
  39. position: absolute;
  40. right: 24px;
  41. top: 72px;
  42. width: auto;
  43. height: 34px;
  44. .tools-box {
  45. float: left;
  46. margin: 0 8px;
  47. .tool {
  48. margin-bottom: 5px;
  49. &:last-child {
  50. margin-bottom: 0;
  51. }
  52. }
  53. }
  54. }
  55. </style>