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