historyChartDaliySelecter.html
3.04 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>历史报表选择器</title>
<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
<link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
<link rel="stylesheet" type="text/css" href="../../css/alarm/alarm.css"/>
<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
<style>
html,
body{
background: rgba(0,0,0,0.4);
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div style="height:100%;z-index:10;" tapmode onclick="closeSelecter();"></div>
<div style="bottom: 0;position:fixed;background-color: #FFFFFF;z-index:11;width:100%;">
<div class="alarm-type-selecter-title">报警类型</div>
<div class="aui-row aui-row-flex" style="margin-top:15px;margin-left:15px;margin-right:15px;">
<div class="aui-col aui-col-span-8 aui-row-flex-center" tapmode onclick="chooseType('type1',1);">
<div class="type-btn" id="type1">按日</div>
</div>
<div class="aui-col aui-col-span-8 aui-row-flex-center" tapmode onclick="chooseType('type2',2);">
<div class="type-btn" id="type2">按月</div>
</div>
<div class="aui-col aui-col-span-8 aui-row-flex-center" tapmode onclick="chooseType('type3',3);">
<div class="type-btn" id="type3">按年</div>
</div>
</div>
<div style="height:30px;"></div>
</div>
<footer></footer>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
var userId;
var token;
apiready = function(){
api.parseTapmode();
var footer = $api.dom('footer'); // 获取 footer 标签元素
var footerH = $api.fixTabBar(footer);
userId = $api.getStorage('userID');
token = $api.getStorage('userToken');
getCurSelect(api.pageParam.selected);
};
function chooseType(idName,value) {
var allDom = $api.domAll('.type-btn');
for (var i = 0; i < allDom.length; i++) {
$api.removeCls(allDom[i], 'type-btn-select');
}
$api.addCls($api.byId(idName), 'type-btn-select');
api.sendEvent({
name: 'changeHistoryChartType',
extra: {
curSelect: value,
}
});
closeSelecter();
}
function getCurSelect(value) {
var allDom = $api.domAll('.type-btn');
for (var i = 0; i < allDom.length; i++) {
$api.removeCls(allDom[i], 'type-btn-select');
}
$api.addCls($api.byId('type'+value), 'type-btn-select');
}
function closeSelecter() {
api.closeFrame();
}
</script>
</html>