config.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { PublicConfigClass } from '@/packages/public'
  2. import { CreateComponentType } from '@/packages/index.d'
  3. import { TextCommonConfig } from './index'
  4. import cloneDeep from 'lodash/cloneDeep'
  5. export enum WritingModeEnum {
  6. HORIZONTAL = '水平',
  7. VERTICAL = '垂直'
  8. }
  9. export const WritingModeObject = {
  10. [WritingModeEnum.HORIZONTAL]: 'horizontal-tb',
  11. [WritingModeEnum.VERTICAL]: 'vertical-rl'
  12. }
  13. export enum FontWeightEnum {
  14. NORMAL = '常规',
  15. BOLD = '加粗',
  16. }
  17. export const FontWeightObject = {
  18. [FontWeightEnum.NORMAL]: 'normal',
  19. [FontWeightEnum.BOLD]: 'bold',
  20. }
  21. export const option = {
  22. link: '',
  23. linkHead: 'http://',
  24. dataset: '我是文本',
  25. fontSize: 20,
  26. fontColor: '#ffffff',
  27. paddingX: 10,
  28. paddingY: 10,
  29. textAlign: 'center', // 水平对齐方式
  30. fontWeight: 'normal',
  31. // 边框
  32. borderWidth: 0,
  33. borderColor: '#ffffff',
  34. borderRadius: 5,
  35. // 字间距
  36. letterSpacing: 5,
  37. writingMode: 'horizontal-tb',
  38. backgroundColor: '#00000000'
  39. }
  40. export default class Config extends PublicConfigClass implements CreateComponentType {
  41. public key = TextCommonConfig.key
  42. public chartConfig = cloneDeep(TextCommonConfig)
  43. public option = cloneDeep(option)
  44. }