index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. :id="item.id"
  18. :chartConfig="item"
  19. :themeSetting="themeSetting"
  20. :themeColor="themeColor"
  21. :style="{ ...getSizeStyle(item.attr) }"
  22. v-on="useLifeHandler(item)"
  23. ></component>
  24. </div>
  25. </template>
  26. <script setup lang="ts">
  27. import { PropType } from 'vue'
  28. import { CreateComponentGroupType } from '@/packages/index.d'
  29. import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from '@/utils'
  30. import { getSizeStyle, getComponentAttrStyle, getStatusStyle } from '../../utils'
  31. import { useLifeHandler } from '@/hooks'
  32. const props = defineProps({
  33. groupData: {
  34. type: Object as PropType<CreateComponentGroupType>,
  35. required: true
  36. },
  37. themeSetting: {
  38. type: Object,
  39. required: true
  40. },
  41. themeColor: {
  42. type: Object,
  43. required: true
  44. },
  45. groupIndex: {
  46. type: Number,
  47. required: true
  48. }
  49. })
  50. </script>
  51. <style lang="scss" scoped>
  52. .chart-item {
  53. position: absolute;
  54. overflow: hidden;
  55. }
  56. </style>