Element.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * Created by zhengguorong on 2016/11/21.
  3. * Modify by liuhaixiao on 2018/07/11
  4. */
  5. export default class Element {
  6. constructor(ele = {}) {
  7. this.type = ele.type || 'pic'
  8. this.imgSrc = ele.imgSrc || ''
  9. this.left = ele.left || 0
  10. this.top = ele.top || 0
  11. this.width = ele.width || 0
  12. this.height = ele.height || 0
  13. this.lineHeight = ele.lineHeight || 0
  14. this.animatedName = ele.animatedName || ''
  15. this.animatedType = ele.animatedType || 0
  16. this.duration = ele.duration || 1
  17. this.delay = ele.delay || 0
  18. this.playing = false
  19. this.loop = false
  20. this.opacity = ele.opacity || 100
  21. this.transform = ele.transform || 0
  22. this.text = ele.text || ''
  23. this.textAlign = ele.textAlign || 'left'
  24. this.verticalAlign = ele.verticalAlign || 'top'
  25. this.display = ele.display || 'block'
  26. this.iconKey = ele.iconKey || ''
  27. this.bg = ele.bg || ''
  28. this.fontSize = ele.fontSize || 24
  29. this.fontFamily = ele.fontFamily || '默认字体'
  30. this.fontWeight = ele.fontWeight || 'normal'
  31. this.color = ele.color || '#000000'
  32. this.selectedColor = ele.selectedColor || '#000000'
  33. this.zindex = ele.zindex || 1
  34. this.backgroundColor = ele.backgroundColor || ''
  35. this.imgSrcMore = ele.imgSrcMore || Array
  36. this.border = ele.border || ''
  37. this.border = ele.border || ''
  38. this.morePic = ele.morePic || []
  39. this.children = ele.children || []
  40. this.textIndent = ele.textIndent || ''
  41. this.letterSpacing = ele.letterSpacing || ''
  42. this.allTransparent = ele.allTransparent
  43. this.audioSrc = ele.audioSrc || ''
  44. this.nodeId = ele.nodeId || ''
  45. this.elabEditable = ele.elabEditable || true
  46. this.locked = ele.locked || false
  47. this.des = ele.des || this.type
  48. this.verticalFont = ele.verticalFont || ''
  49. this.shadowColor = ele.shadowColor || ''
  50. this.shadowX = ele.shadowX || 0
  51. this.shadowY = ele.shadowY || 0
  52. this.shadowVague = ele.shadowVague || 0
  53. this.circular = ele.circular || 0
  54. this.videoEditable = ele.videoEditable || false
  55. this.animatedEnabled = ele.animatedEnabled || true
  56. this.animatedFont = ele.animatedFont || ''
  57. this.eleCanvas = ele.eleCanvas || ''
  58. this.swiperType = ele.swiperType || 'mtswiper'
  59. this.fixed = ele.fixed || false
  60. this.backgroundSelectedImg = ele.backgroundSelectedImg || ''
  61. this.backgroundUnselectedImg = ele.backgroundUnselectedImg || ''
  62. this.questionId = ele.questionId || 0
  63. this.optionId = ele.optionId || 0
  64. this.href = ele.href ||''
  65. }
  66. }