element.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. const DEFAULT_COLOR = '#41464b'
  2. export enum ElementTypes {
  3. TEXT = '文本',
  4. IMAGE = '图片',
  5. SHAPE = '形状',
  6. LINE = '线条',
  7. CHART = '图表',
  8. TABLE = '表格',
  9. }
  10. export const DEFAULT_TEXT = {
  11. type: 'text',
  12. left: 0,
  13. top: 0,
  14. width: 300,
  15. height: 0,
  16. opacity: 1,
  17. lineHeight: 1.5,
  18. segmentSpacing: 5,
  19. content: '请输入内容',
  20. }
  21. export const DEFAULT_IMAGE = {
  22. type: 'image',
  23. left: 0,
  24. top: 0,
  25. lockRatio: true,
  26. }
  27. export const DEFAULT_SHAPE = {
  28. type: 'shape',
  29. fill: DEFAULT_COLOR,
  30. lockRatio: false,
  31. }
  32. export const DEFAULT_LINE = {
  33. type: 'line',
  34. style: 'solid',
  35. marker: ['', ''],
  36. width: 4,
  37. color: DEFAULT_COLOR,
  38. }
  39. export const DEFAULT_CHART = {
  40. type: 'chart',
  41. left: 0,
  42. top: 0,
  43. width: 500,
  44. height: 500,
  45. }
  46. export const DEFAULT_TABLE = {
  47. type: 'table',
  48. left: 0,
  49. top: 0,
  50. isLock: false,
  51. borderStyle: 'solid',
  52. borderWidth: 2,
  53. borderColor: DEFAULT_COLOR,
  54. }
  55. export enum OPERATE_KEYS {
  56. LEFT_TOP = 1,
  57. TOP = 2,
  58. RIGHT_TOP = 3,
  59. LEFT = 4,
  60. RIGHT = 5,
  61. LEFT_BOTTOM = 6,
  62. BOTTOM = 7,
  63. RIGHT_BOTTOM = 8,
  64. }