index.ts
866 Bytes
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
import imgUrl_one from '@/assets/bi/template-old.png';
import imgUrl_two from '@/assets/bi/template-new.png';
/**
* 统计数据下拉框
*/
const coreSubStatOption = [
{
id: 1,
label: "年发电",
key: "year_pv_power",
value: false,
},
{
id: 2,
label: "年储能",
key: "year_storage_power",
value: false,
},
{
id: 3,
label: "年充电",
key: "year_charge_power",
value: false,
}]
/**
* 模板
*/
const previewList = [{
id: '1',
imgUrl: imgUrl_one,
name: '默认模板'
}, {
id: '2',
imgUrl: imgUrl_two,
name: '电力科技'
}];
// 筛选出单选框和复选框的初始值
const reduceArr = (arr: Array<any>) => {
return arr.reduce((accumulator: Array<string>, item: any) => {
if (item.value) {
accumulator.push(item.key);
}
return accumulator;
}, [])
};
export {
previewList,
coreSubStatOption,
reduceArr
}