config.ts
1.27 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
import { formatToDateTime } from '/@/utils/dateUtil';
export interface TextComponentLayout {
id: string;
base?: boolean;
showUpdate?: boolean;
showIcon?: boolean;
showUnit?: boolean;
}
export interface TextComponentValue {
name: string;
value: number;
icon?: string;
unit?: string;
updateTime?: string;
fontColor?: string;
iconColor?: string;
}
type TextComponentDefault = TextComponentLayout & { value: TextComponentValue };
export const textComponentConfig: TextComponentDefault[] = [
{ id: 'text-component-1', base: true, value: { value: 123, name: '温度' } },
{ id: 'text-component-2', base: false, value: { value: 123, name: '温度' } },
{
id: 'text-component-3',
base: false,
showUpdate: true,
value: {
value: 123,
name: '温度',
updateTime: formatToDateTime(new Date(), 'YYYY-MM-DD HH:mm:ss'),
},
},
{
id: 'text-component-4',
base: false,
showIcon: true,
showUpdate: true,
showUnit: true,
value: {
value: 123,
name: '温度',
updateTime: formatToDateTime(new Date(), 'YYYY-MM-DD HH:mm:ss'),
unit: '℃',
},
},
{
id: 'text-component-5',
base: false,
showIcon: true,
showUnit: true,
value: { value: 123, name: '温度', unit: '℃' },
},
];