index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <ContentBox
  3. class="go-content-layers"
  4. :class="{ scoped: !chartLayoutStore.getLayers }"
  5. title="图层"
  6. :depth="2"
  7. @back="backHandle"
  8. >
  9. <template #icon>
  10. <n-icon size="16" :depth="2">
  11. <component :is="LayersIcon" />
  12. </n-icon>
  13. </template>
  14. <!-- 图层内容 -->
  15. <ListItem
  16. v-for="item in chartEditStore.getComponentList"
  17. :key="item.id"
  18. :componentData="item"
  19. />
  20. </ContentBox>
  21. </template>
  22. <script setup lang="ts">
  23. import { ContentBox } from '../ContentBox/index'
  24. import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
  25. import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
  26. import { useChartEditStoreStore } from '@/store/modules/chartEditStore/chartEditStore'
  27. import { ListItem } from './components/ListItem/index'
  28. import { icon } from '@/plugins'
  29. const { LayersIcon } = icon.ionicons5
  30. const chartLayoutStore = useChartLayoutStore()
  31. const chartEditStore = useChartEditStoreStore()
  32. const backHandle = () => {
  33. chartLayoutStore.setItem(ChartLayoutStoreEnum.LAYERS, false)
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. $wight: 150px;
  38. @include go(content-layers) {
  39. width: $wight;
  40. flex-shrink: 0;
  41. overflow: hidden;
  42. @extend .go-transition;
  43. &.scoped {
  44. width: 0;
  45. }
  46. }
  47. </style>