index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div
  3. class="chart-item"
  4. v-for="item in groupData.groupList"
  5. :class="animationsClass(item.styles.animations)"
  6. :key="item.id"
  7. :style="{
  8. ...getComponentAttrStyle(item.attr, groupIndex),
  9. ...getFilterStyle(item.styles),
  10. ...getTransformStyle(item.styles),
  11. ...getStatusStyle(item.status),
  12. ...getBlendModeStyle(item.styles) as any
  13. }"
  14. >
  15. <component
  16. :is="item.chartConfig.chartKey"
  17. :chartConfig="item"
  18. :themeSetting="themeSetting"
  19. :themeColor="themeColor"
  20. :style="{ ...getSizeStyle(item.attr) }"
  21. ></component>
  22. </div>
  23. </template>
  24. <script setup lang="ts">
  25. import { PropType } from 'vue'
  26. import { CreateComponentGroupType } from '@/packages/index.d'
  27. import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from '@/utils'
  28. import { getSizeStyle, getComponentAttrStyle, getStatusStyle } from '../../utils'
  29. const props = defineProps({
  30. groupData: {
  31. type: Object as PropType<CreateComponentGroupType>,
  32. required: true
  33. },
  34. themeSetting: {
  35. type: Object,
  36. required: true
  37. },
  38. themeColor: {
  39. type: Object,
  40. required: true
  41. },
  42. groupIndex: {
  43. type: Number,
  44. required: true
  45. }
  46. })
  47. </script>
  48. <style lang="scss" scoped>
  49. .chart-item {
  50. position: absolute;
  51. }
  52. </style>