protect_frm.html
5.67 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!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>保护动作_frm</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/protect/protect.css"/>
<style>
html,
body{
background-color: #F4F6F9;
}
</style>
</head>
<body>
<div class="protect-panel" id="protect_panel">
<!-- <div class="protect-list">
<div class="info-panel">
<div class="aui-row aui-row-flex top-14">
<div class="aui-col aui-col-span-2 aui-row-flex-start">
<div class="number-id">01</div>
</div>
<div class="aui-col aui-col-span-6 aui-row-flex-start">
<span class="action-name">漏电动作</span>
</div>
<div class="aui-col aui-col-span-16 aui-row-flex-end">
<span class="action-time">2019-07-15 12:32:16</span>
</div>
</div>
<div class="list-line"></div>
<div class="aui-row aui-row-flex">
<div class="aui-col aui-col-span-5 aui-row-flex-center">
<span class="details-value">0.00</span><span class="details-value2">A</span>
<div class="title-value-panel">
<p class="title-value">电流</p>
</div>
</div>
<div class="aui-col aui-col-span-5 aui-row-flex-center">
<span class="details-value">220</span><span class="details-value2">V</span>
<div class="title-value-panel">
<p class="title-value" >电压</p>
</div>
</div>
<div class="aui-col aui-col-span-5 aui-row-flex-center">
<span class="details-value">27</span><span class="details-value2">mA</span>
<div class="title-value-panel">
<p class="title-value" >漏电电流</p>
</div>
</div>
<div class="aui-col aui-col-span-4 aui-row-flex-center">
<span class="details-value">37</span><span class="details-value2">℃</span>
<div class="title-value-panel">
<p class="title-value" >温度</p>
</div>
</div>
<div class="aui-col aui-col-span-5 aui-row-flex-center">
<span class="details-value">20</span><span class="details-value2">ms</span>
<div class="title-value-panel">
<p class="title-value" >动作时长</p>
</div>
</div>
</div>
</div>
</div> -->
</div>
</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;
var defaultImei;
var page = 1;
var pageSize = 5;
var selectedDate = '';
var actionType = '';
var sequence = 0;
var selected_status = 'all';
apiready = function(){
api.parseTapmode();
defaultImei = $api.getStorage('defaultDevice');
token = $api.getStorage('userToken');
userId = $api.getStorage('userID');
/**上拉加载 */
api.addEventListener({
name: 'scrolltobottom',
extra: {
threshold: 0
}
}, function(ret, err) {
page += 1;
getProtectList();
});
/** 下拉刷新 */
api.setRefreshHeaderInfo({
loadingImg:'',
bgColor: '#FFFFFF',
textColor: '#000',
textDown: '刷新保护动作列表...',
textUp: '松开刷新...'
}, function(ret, err) {
page = 1;
selectedDate = '';
actionType = '';
sequence = 0;
//---移除dom中的所有元素
var allDom = $api.domAll('.protect-list');
for (var i = 0; i < allDom.length; i++) {
$api.remove(allDom[i]);
}
sequence = 0;
//-----
getProtectList();
api.refreshHeaderLoadDone();
});
getProtectList();
};
function getProtectList() {
api.ajax({
url: HOST + '/iot_api/v1/app/get_action_list',
method: 'GET',
headers: {
'Content-Type': 'application/json;charset=utf-8',
'token': token
},
data: {
body: {
page: page,
limit: pageSize,
imei: defaultImei,
user_id: userId,
}
}
}, function(ret, err) {
if (ret.code == 0) {
var protectList = ret.data.rows;
if (protectList.length == 0) {
}else {
for(var i in protectList){
sequence += 1;
var addProtectListDom = addProtectListHtml(protectList[i],sequence);
$api.append($api.byId("protect_panel"), addProtectListDom);
}
if (!ret.data.next) {
api.toast({msg: '已无更多数据',duration: 2000,location: 'bottom'});
}
}
}else {
api.toast({msg: '网络错误',duration: 2000,location: 'bottom'});
}
});
}
</script>
</html>