FormatEle.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <script setup>
  2. import {ref} from 'vue'
  3. import {getPPTContentType,getPPTContentItemData,getPPTLayerType} from '../hooks/createPPTContent'
  4. const props=defineProps({
  5. pageData:{
  6. type:Object,
  7. default:{}
  8. }
  9. })
  10. const lang=ref(window.location.pathname.startsWith('/ppten')?'en':'zh')
  11. </script>
  12. <template>
  13. <div :class="['ppt-item-box ppt-item-page',lang=='en'?'ppt-item-box_en':'']">
  14. <!-- <div class="ppt-title-box">{{pageData.title}}</div> -->
  15. <!-- 自定义标题 -->
  16. <div class="custom-title-wrap"
  17. :style="pageData.titleDetail?{
  18. left:pageData.titleDetail.left+'%',
  19. top:pageData.titleDetail.top+'%',
  20. width:pageData.titleDetail.width+'%',
  21. height:pageData.titleDetail.height+'%',
  22. }:{
  23. left:'10%',top:'6.6%',width:'68%',height:'5%',
  24. }"
  25. >
  26. <div class="title" v-html="pageData.title"
  27. :style="pageData.titleDetail?{
  28. color:pageData.titleDetail.color||'#333',
  29. fontSize:(pageData.titleDetail.fontSize||22)+'px',
  30. fontFamily:pageData.titleDetail.fontFamily||'helvetica'
  31. }:{ color:'#333',fontSize:'22px',fontFamily:'helvetica' }"
  32. ></div>
  33. </div>
  34. <div class="ppt-content-box">
  35. <div class="container">
  36. <div class="line">
  37. <div class="line-item">
  38. <component
  39. :is="getPPTContentType(1,pageData.elements)"
  40. :itemData="getPPTContentItemData(1,pageData)"
  41. />
  42. </div>
  43. <div class="line-item">
  44. <component
  45. :is="getPPTContentType(2,pageData.elements)"
  46. :itemData="getPPTContentItemData(2,pageData)"
  47. />
  48. </div>
  49. </div>
  50. <div class="line">
  51. <div class="line-item">
  52. <component
  53. :is="getPPTContentType(3,pageData.elements)"
  54. :itemData="getPPTContentItemData(3,pageData)"
  55. />
  56. </div>
  57. <div class="line-item">
  58. <component
  59. :is="getPPTContentType(4,pageData.elements)"
  60. :itemData="getPPTContentItemData(4,pageData)"
  61. />
  62. </div>
  63. </div>
  64. <div class="bottom-18">
  65. <component
  66. :is="getPPTContentType(5,pageData.elements)"
  67. :itemData="getPPTContentItemData(5,pageData)"
  68. />
  69. </div>
  70. </div>
  71. <div class="layer-wrap">
  72. <template v-for="item in pageData.layers" :key="item.id">
  73. <component
  74. :is="getPPTLayerType(item)"
  75. :itemData="item"
  76. />
  77. </template>
  78. </div>
  79. </div>
  80. </div>
  81. </template>
  82. <style scoped lang="scss">
  83. // @import '../style/common.scss';
  84. .ppt-content-box{
  85. .container{
  86. .line{
  87. display: flex;
  88. justify-content: space-between;
  89. height:40%;
  90. .line-item{
  91. width:45%;
  92. }
  93. }
  94. .bottom-18{
  95. width:100%;
  96. height:18%;
  97. .rich-text-box{
  98. width:90%;
  99. height:100%;
  100. }
  101. }
  102. }
  103. }
  104. </style>