ScreenChartElement.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div class="screen-element-chart"
  3. :style="{
  4. top: elementInfo.top + 'px',
  5. left: elementInfo.left + 'px',
  6. width: elementInfo.width + 'px',
  7. height: elementInfo.height + 'px',
  8. }"
  9. >
  10. <div
  11. class="element-content"
  12. :style="{
  13. backgroundColor: elementInfo.fill,
  14. }"
  15. >
  16. <ElementOutline
  17. :width="elementInfo.width"
  18. :height="elementInfo.height"
  19. :outline="elementInfo.outline"
  20. />
  21. <Chart
  22. :width="elementInfo.width"
  23. :height="elementInfo.height"
  24. :type="elementInfo.chartType"
  25. :data="elementInfo.data"
  26. :options="elementInfo.options"
  27. />
  28. </div>
  29. </div>
  30. </template>
  31. <script lang="ts">
  32. import { defineComponent, PropType } from 'vue'
  33. import { PPTChartElement } from '@/types/slides'
  34. import ElementOutline from '@/views/components/element/ElementOutline.vue'
  35. import Chart from '@/components/Chart.vue'
  36. export default defineComponent({
  37. name: 'screen-element-chart',
  38. components: {
  39. ElementOutline,
  40. Chart,
  41. },
  42. props: {
  43. elementInfo: {
  44. type: Object as PropType<PPTChartElement>,
  45. required: true,
  46. },
  47. },
  48. })
  49. </script>
  50. <style lang="scss" scoped>
  51. .screen-element-chart {
  52. position: absolute;
  53. }
  54. .element-content {
  55. width: 100%;
  56. height: 100%;
  57. }
  58. </style>