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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
| export enum PropertyFormatEnum {
| // 整数
| Integer = 1,
|
| // 长整数
| Bigint = 2,
|
| // 数值
| Numeric = 3,
|
| // 文本
| Text = 4,
|
| // 多文本
| MultiText = 5,
|
| // 时间
| Time = 6,
|
| // 布尔值
| Boolean = 7,
| }
| export const FORMAT_MAP = {
| [PropertyFormatEnum.Integer]: '整数',
| [PropertyFormatEnum.Bigint]: '长整数',
| [PropertyFormatEnum.Numeric]: '数值',
| [PropertyFormatEnum.Text]: '文本',
| [PropertyFormatEnum.MultiText]: '多文本',
| [PropertyFormatEnum.Time]: '时间',
| [PropertyFormatEnum.Boolean]: '布尔值',
| } as const;
|
| // 使用 input 组件的 format
| export const INPUT_FORMAT = [
| PropertyFormatEnum.Integer,
| PropertyFormatEnum.Bigint,
| PropertyFormatEnum.Numeric,
| PropertyFormatEnum.Text,
| PropertyFormatEnum.MultiText,
| ];
|
| export enum ExtendTypeEnum {
| // 无
| None = 0,
| // 固有
| Innate = 1,
| // 继承
| Inherit = 2,
| }
|
| export const EXTEND_TYPE_MAP = {
| [ExtendTypeEnum.None]: '无',
| [ExtendTypeEnum.Innate]: '固有',
| [ExtendTypeEnum.Inherit]: '继承',
| };
|
| export const enum CronTypeEnum {
| RealTime = 0,
| Hourly = 1,
| Daily = 2,
| Monthly = 3,
| Yearly = 4,
| }
|
| export const CRON_TYPE_MAP = {
| [CronTypeEnum.RealTime]: '实时',
| [CronTypeEnum.Hourly]: '每时',
| [CronTypeEnum.Daily]: '每日',
| [CronTypeEnum.Monthly]: '每月',
| [CronTypeEnum.Yearly]: '每年',
| };
|
| // 来源类型
| export enum SourceTypeEnum {
| Docking = 0,
| Analyse = 1,
| Input = 2,
| Custom = 3,
| }
| export const SOURCE_TYPE_MAP = {
| [SourceTypeEnum.Docking]: '对接',
| [SourceTypeEnum.Analyse]: '分析',
| [SourceTypeEnum.Input]: '录入',
| [SourceTypeEnum.Custom]: '定制',
| };
| // 计量类型
| export enum MeasureTypeEnum {
| Instant = 1,
| Accumulate = 2,
| }
| export const MEASURE_TYPE_MAP = {
| [MeasureTypeEnum.Instant]: '瞬时',
| [MeasureTypeEnum.Accumulate]: '累积',
| };
|
| export enum SignalTypeFormatEnum {
| // 数值
| Numeric = 1,
|
| // 枚举
| Enumeration = 2,
|
| // 集合
| Collection = 3,
|
| // 集成
| Integration = 4,
|
| // 文本
| Text = 5,
|
| // 图谱
| Graph = 6,
| }
| // 格式类型
| export const formatTypeEnum = {
| [SignalTypeFormatEnum.Numeric]: '数值',
| [SignalTypeFormatEnum.Enumeration]: '枚举',
| [SignalTypeFormatEnum.Collection]: ' 集合',
| [SignalTypeFormatEnum.Integration]: '集成',
| [SignalTypeFormatEnum.Text]: ' 文本',
| [SignalTypeFormatEnum.Graph]: ' 图谱',
| };
|
| export type TreeProps = {
| id: string;
| label: string;
| children?: string;
| };
|
| export const enum TimeEnum {
| Second = 1,
| Minute = 2,
| Hour = 3,
| Day = 4,
| }
| export const timeEnumMap = {
| [TimeEnum.Day]: '天',
| [TimeEnum.Hour]: '小时',
| [TimeEnum.Minute]: '分钟',
| [TimeEnum.Second]: '秒',
| };
|
| export const timeEnumMapCount = {
| [TimeEnum.Day]: 3600 * 24,
| [TimeEnum.Hour]: 3600,
| [TimeEnum.Minute]: 60,
| [TimeEnum.Second]: 1,
| };
|
|