timeConfig.ts
2.33 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
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
interface IOptionConfig {
label: string;
value: number;
}
export const optionsConfig: IOptionConfig[] = [
{
label: '1秒',
value: 1000,
},
{
label: '5秒',
value: 5000,
},
{
label: '10秒',
value: 10000,
},
{
label: '15秒',
value: 15000,
},
{
label: '30秒',
value: 30000,
},
{
label: '1分钟',
value: 60000,
},
{
label: '2分钟',
value: 120000,
},
{
label: '5分钟',
value: 300000,
},
{
label: '10分钟',
value: 600000,
},
{
label: '15分钟',
value: 900000,
},
{
label: '30分钟',
value: 1800000,
},
{
label: '1小时',
value: 3600000,
},
{
label: '2小时',
value: 7200000,
},
{
label: '5小时',
value: 18000000,
},
{
label: '10小时',
value: 36000000,
},
{
label: '12小时',
value: 43200000,
},
{
label: '1天',
value: 86400000,
},
];
export enum TypeEnum {
IS_TIMING = 1,
IS_WEEK = 'week',
IS_MONTH = 'month',
IS_EMPTY = 'NONE',
IS_DEFAULT_WEEK = 'defaultIsWeek',
IS_FIXED_WEEK = '2',
IS_MIN = 'MIN',
IS_MAX = 'MAX',
IS_AVG = 'AVG',
IS_SUM = 'SUM',
COUNT = 'COUNT',
IS_FIXED_TIME = 1,
}
export enum AggregateDataEnum {
MIN = 'MIN',
MAX = 'MAX',
AVG = 'AVG',
SUM = 'SUM',
COUNT = 'COUNT',
NONE = 'NONE',
}
export const isFixedTime = (type: string) => {
return type === TypeEnum.IS_FIXED_TIME;
};
export const isTiming = (type: string) => {
return type === TypeEnum.IS_TIMING;
};
export const isWeek = (type: string) => {
return type === TypeEnum.IS_WEEK;
};
export const isMonth = (type: string) => {
return type === TypeEnum.IS_MONTH;
};
export const isEmpty = (type: string) => {
return type === TypeEnum.IS_EMPTY;
};
export const isDefultWeek = (type: string) => {
return type === TypeEnum.IS_DEFAULT_WEEK;
};
export const isFixedWeek = (type: string) => {
return type === TypeEnum.IS_FIXED_WEEK;
};
export const isMin = (type: string) => {
return type === TypeEnum.IS_MIN;
};
export const isMax = (type: string) => {
return type === TypeEnum.IS_MAX;
};
export const isAvg = (type: string) => {
return type === TypeEnum.IS_AVG;
};
export const isSum = (type: string) => {
return type === TypeEnum.IS_SUM;
};
export const isCountAll = (type: string) => {
return type === TypeEnum.COUNT;
};