index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 v-for="item in chartEditStore.getComponentList" :key="item.id"/>
  16. </ContentBox>
  17. </template>
  18. <script setup lang="ts">
  19. import { ContentBox } from '../ContentBox/index'
  20. import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
  21. import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
  22. import { useChartEditStoreStore } from '@/store/modules/chartEditStore/chartEditStore'
  23. import { ListItem } from './components/ListItem/index'
  24. import { icon } from '@/plugins'
  25. const { LayersIcon } = icon.ionicons5
  26. const chartLayoutStore = useChartLayoutStore()
  27. const chartEditStore = useChartEditStoreStore()
  28. const backHandle = () => {
  29. chartLayoutStore.setItem(ChartLayoutStoreEnum.LAYERS, false)
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. $wight: 150px;
  34. @include go(content-layers) {
  35. width: $wight;
  36. flex-shrink: 0;
  37. overflow: hidden;
  38. @extend .go-transition;
  39. &.scoped {
  40. width: 0;
  41. }
  42. }
  43. </style>