device_details_frm.html
40.1 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
<!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">
<meta name="referrer" content="no-referrer">
<title>设备详情_frm</title>
<link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/api.css"/>
<link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/aui.css"/>
<link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/home.css"/>
<link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/element.css"/>
<link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/style.css"/>
<style>
html,
body{
background: #F4F6F9;
}
.el-divider__text{
background-color: #F4F6F9;
}
</style>
</head>
<body>
<div id="app">
<template>
<div class="store01001-device-title">
<div style="margin-left:15px;margin-right:15.5px;">
<div class="aui-row aui-row-flex top-14">
<div class="aui-col aui-col-span-1">
<div class="store01001-title-sign" style="margin-top: 0.55rem;"></div>
</div>
<div class="aui-col aui-col-span-15">
<span class="store01001-device-details-name" style="margin-top: 0.6rem;">设备编号:{{ imei }}</span>
</div>
<div class="aui-col aui-col-span-8 aui-row-flex-end">
</div>
</div>
</div>
</div>
<div class="store01001-info-title2">
<el-row>
<el-col :span=8>{{ deviceServerInfoTitle }}</el-col>
<el-col :span=16 class="store01001-device-details-time">{{ updateTime }} 更新</el-col>
</el-row>
</div>
<div class="store01001-device-details-infos">
<div class="store01001-device-details-list-panel">
<div class="store01001-device-details-list-panel-inside">
<el-row class="store01001-device-details-list-area" v-for="(list_d, list_i) in serverInfoList">
<div tapmode @click="editServerInfo(list_i)">
<el-col :span=3>
<img :src="list_d.img" style="height: 22px;" />
</el-col>
<el-col :span=7>
<span>{{list_d.name}}</span>
</el-col>
<el-col :span=list_d.span1 style="text-align: right;">
<span v-if="list_i===7 || list_i===8 || list_i===9" class="hidden-font-one-line" style="color:rgba(174,184,206,1);font-size:12px;text-align: right;">{{list_d.extra1 | titleFilter }}</span>
</el-col>
<el-col :span=list_d.span2 v-if="userType === 1">
<el-row v-if="list_i===0 || list_i===1 || list_i===2 || list_i===3 || list_i===4 || list_i===5 || list_i===6">
<el-col :span=18>
<img v-if="list_d.extra2 === 0" src="http://iot.uccc.cc:9090/product/01001/icon_badgeDot_red.png" style="height: 12px;float: right;margin-top: 1.65rem;" />
<img v-if="list_d.extra2 === 1" src="http://iot.uccc.cc:9090/product/01001/icon_badgeDot_green.png" style="height: 12px;float: right;margin-top: 1.65rem;" />
</el-col>
<el-col :span=6>
<span v-if="list_i===0 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 离线</span>
<span v-if="list_i===1 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 报警</span>
<span v-if="list_i===2 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 故障</span>
<span v-if="list_i===3 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 动作</span>
<span v-if="list_i===4 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 动作</span>
<span v-if="list_i===5 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 动作</span>
<span v-if="list_i===6 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 动作</span>
<span v-if="list_i===0 && list_d.extra2 === 1" style="font-size:14px;color:rgba(112,194,72,1);"> 在线</span>
<span v-if="list_i===1 && list_d.extra2 === 1" style="font-size:14px;color:rgba(112,194,72,1);"> 正常</span>
<span v-if="list_i===2 && list_d.extra2 === 1" style="font-size:14px;color:rgba(112,194,72,1);"> 正常</span>
<span v-if="list_i===3 && list_d.extra2 === 1" style="font-size:12px;color:rgba(112,194,72,1);">未动作</span>
<span v-if="list_i===4 && list_d.extra2 === 1" style="font-size:12px;color:rgba(112,194,72,1);">未动作</span>
<span v-if="list_i===5 && list_d.extra2 === 1" style="font-size:12px;color:rgba(112,194,72,1);">未动作</span>
<span v-if="list_i===6 && list_d.extra2 === 1" style="font-size:12px;color:rgba(112,194,72,1);">未动作</span>
</el-col>
</el-row>
<i v-if="list_i===7 || list_i===8 || list_i===9" class="aui-iconfont aui-icon-right"></i>
</el-col>
<el-col :span=list_d.span2 v-if="userType === 2">
<el-row v-if="list_i===0 || list_i===1 || list_i===2 || list_i===3 || list_i===4 || list_i===5 || list_i===6">
<el-col :span=18>
<img v-if="list_d.extra2 === 0" src="http://iot.uccc.cc:9090/product/01001/icon_badgeDot_red.png" style="height: 12px;float: right;margin-top: 1.65rem;" />
<img v-if="list_d.extra2 === 1" src="http://iot.uccc.cc:9090/product/01001/icon_badgeDot_green.png" style="height: 12px;float: right;margin-top: 1.65rem;" />
</el-col>
<el-col :span=6>
<span v-if="list_i===0 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 离线</span>
<span v-if="list_i===1 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 报警</span>
<span v-if="list_i===2 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 故障</span>
<span v-if="list_i===3 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 动作</span>
<span v-if="list_i===4 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 动作</span>
<span v-if="list_i===5 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 动作</span>
<span v-if="list_i===6 && list_d.extra2 === 0" style="font-size:14px;color:rgba(250,82,81,1);"> 动作</span>
<span v-if="list_i===0 && list_d.extra2 === 1" style="font-size:14px;color:rgba(112,194,72,1);"> 在线</span>
<span v-if="list_i===1 && list_d.extra2 === 1" style="font-size:14px;color:rgba(112,194,72,1);"> 正常</span>
<span v-if="list_i===2 && list_d.extra2 === 1" style="font-size:14px;color:rgba(112,194,72,1);"> 正常</span>
<span v-if="list_i===3 && list_d.extra2 === 1" style="font-size:12px;color:rgba(112,194,72,1);">未动作</span>
<span v-if="list_i===4 && list_d.extra2 === 1" style="font-size:12px;color:rgba(112,194,72,1);">未动作</span>
<span v-if="list_i===5 && list_d.extra2 === 1" style="font-size:12px;color:rgba(112,194,72,1);">未动作</span>
<span v-if="list_i===6 && list_d.extra2 === 1" style="font-size:12px;color:rgba(112,194,72,1);">未动作</span>
</el-col>
</el-row>
<!-- <i v-if="list_i===8 || list_i===9" class="aui-iconfont aui-icon-right"></i> -->
</el-col>
<!-- ---- -->
</div>
</el-row>
</div>
</div>
</div>
<div class="store01001-info-title2">
<el-row>
<el-col :span=8>{{ deviceMeasureInfoTitle }}</el-col>
<el-col :span=16 class="store01001-device-details-time">{{ updateTime }} 更新</el-col>
</el-row>
</div>
<el-divider content-position="left" style="background-color: red;"><span >{{ info1 }}</span></el-divider>
<div class="store01001-device-details-infos">
<div class="store01001-device-details-measure-area">
<el-row>
<div v-for="(list_d, list_i) in measureInfoListTemp">
<el-col :span=11 :offset=list_d.offset class="store01001-device-details-measure-card" style="height: 4.5rem;">
<el-row>
<el-col :span=1 style="height: 3rem;"> </el-col>
<el-col :span=9 style="height: 3rem;">
<!-- img/name -->
<img :src="list_d.img" class="store01001-device-details-measure-img" style="margin-top: 1rem;"/>
</el-col>
<el-col :span=13 style="height: 3rem;">
<!-- value -->
<span class="store01001-device-details-measure-value" style="color: #5B7FF8;">{{ list_d.value }}</span>
</el-col>
<el-col :span=1 style="height: 3rem;">
</el-col>
<el-col :span=4 style="height: 1rem;"> </el-col>
<el-col :span=13 style="height: 1rem;" style="text-align: left;">
<div class="store01001-device-details-measure-value" style="text-align: left;line-height: 1rem;text-align: left;font-size: 12px;">
{{ list_d.name }}
</div>
</el-col>
<el-col :span=6 style="height: 1rem;">
<span class="store01001-device-details-measure-value" style="line-height: 1rem;color: #5B7FF8;">{{ list_d.unit }}</span>
</el-col>
</el-row>
</el-col>
</div>
</el-row>
<el-divider content-position="left">{{ info2 }}</el-divider>
<el-row>
<div v-for="(list_d, list_i) in measureInfoListTemp2">
<el-col :span=11 :offset=list_d.offset class="store01001-device-details-measure-card" style="height: 4.5rem;">
<el-row>
<el-col :span=1 style="height: 3rem;"> </el-col>
<el-col :span=9 style="height: 3rem;">
<!-- img/name -->
<img :src="list_d.img" class="store01001-device-details-measure-img" style="margin-top: 1rem;"/>
</el-col>
<el-col :span=13 style="height: 3rem;">
<!-- value -->
<span class="store01001-device-details-measure-value">{{ list_d.value }}</span>
</el-col>
<el-col :span=1 style="height: 3rem;">
</el-col>
<el-col :span=4 style="height: 1rem;"> </el-col>
<el-col :span=13 style="height: 1rem;" style="text-align: left;">
<div class="store01001-device-details-measure-value" style="text-align: left;line-height: 1rem;text-align: left;font-size: 12px;">
{{ list_d.name }}
</div>
</el-col>
<el-col :span=6 style="height: 1rem;">
<span class="store01001-device-details-measure-value" style="line-height: 1rem;">{{ list_d.unit }}</span>
</el-col>
</el-row>
</el-col>
</div>
</el-row>
<el-divider content-position="left">{{ info3 }}</el-divider>
<el-row>
<div v-for="(list_d, list_i) in measureInfoListTemp3">
<el-col :span=11 :offset=list_d.offset class="store01001-device-details-measure-card" style="height: 4.5rem;">
<el-row>
<el-col :span=1 style="height: 3rem;"> </el-col>
<el-col :span=9 style="height: 3rem;">
<!-- img/name -->
<img :src="list_d.img" class="store01001-device-details-measure-img" style="margin-top: 1rem;"/>
</el-col>
<el-col :span=13 style="height: 3rem;">
<!-- value -->
<span class="store01001-device-details-measure-value">{{ list_d.value }}</span>
</el-col>
<el-col :span=1 style="height: 3rem;">
</el-col>
<el-col :span=4 style="height: 1rem;"> </el-col>
<el-col :span=13 style="height: 1rem;" style="text-align: left;">
<div class="store01001-device-details-measure-value" style="text-align: left;line-height: 1rem;text-align: left;font-size: 12px;">
{{ list_d.name }}
</div>
</el-col>
<el-col :span=6 style="height: 1rem;">
<span class="store01001-device-details-measure-value" style="line-height: 1rem;">{{ list_d.unit }}</span>
</el-col>
</el-row>
</el-col>
</div>
</el-row>
<el-divider content-position="left">{{ info4 }}</el-divider>
<el-row>
<div v-for="(list_d, list_i) in measureInfoListTemp4">
<el-col :span=11 :offset=list_d.offset class="store01001-device-details-measure-card" style="height: 4.5rem;">
<el-row>
<el-col :span=1 style="height: 3rem;"> </el-col>
<el-col :span=9 style="height: 3rem;">
<!-- img/name -->
<img :src="list_d.img" class="store01001-device-details-measure-img" style="margin-top: 1rem;"/>
</el-col>
<el-col :span=13 style="height: 3rem;">
<!-- value -->
<span class="store01001-device-details-measure-value">{{ list_d.value }}</span>
</el-col>
<el-col :span=1 style="height: 3rem;">
</el-col>
<el-col :span=4 style="height: 1rem;"> </el-col>
<el-col :span=13 style="height: 1rem;" style="text-align: left;">
<div class="store01001-device-details-measure-value" style="text-align: left;line-height: 1rem;text-align: left;font-size: 12px;">
{{ list_d.name }}
</div>
</el-col>
<el-col :span=6 style="height: 1rem;">
<span class="store01001-device-details-measure-value" style="line-height: 1rem;">{{ list_d.unit }}</span>
</el-col>
</el-row>
</el-col>
</div>
</el-row>
</div>
</div>
</template>
</div>
</body>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/api.js"></script>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/vue.min.js"></script>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/common.js"></script>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/element.js"></script>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/ctrl.js"></script>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/fastclick.js"></script>
<script type="text/javascript">
var vm,
that,
inputDialogJSON;
apiready = function(){
api.parseTapmode();
inputDialogJSON = returnInputDialogJSON()
$(function() {
FastClick.attach(document.body);
});
//---------初始化vue
vm = new Vue({
el: '#app',
data: {
productId: api.pageParam.productId,
imei: api.pageParam.imei,
deviceServerInfoTitle: '设备终端信息',
deviceMeasureInfoTitle: '用电测量信息',
serverInfoListTemp: [
{img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_sbzt.png", name: '设备状态', extra1: '', extra2: 0, span1: 0, span2: 14},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_bjzt.png", name: '报警状态', extra1: '', extra2: 0, span1: 0, span2: 14},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_gzzt.png", name: '故障状态', extra1: '', extra2: 0, span1: 0, span2: 14},
{img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_kgzt.png", name: 'DO1', extra1: '', extra2: 0, span1: 0, span2: 14},
{img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_kgzt.png", name: 'DO2', extra1: '', extra2: 0, span1: 0, span2: 14},
{img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_kgzt.png", name: 'DI1', extra1: '', extra2: 0, span1: 0, span2: 14},
{img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_kgzt.png", name: 'DI2', extra1: '', extra2: 0, span1: 0, span2: 14},
// {img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_sbwz.png", name: '设备位置', extra1: '', extra2: '', span1: 12, span2: 2}, //设备位置
// {img: "http://iot.uccc.cc:9090/product/01001/sbmm.png", name: '设备密码', extra1: '修改设备密码', extra2: '', span1: 12, span2: 2},
// {img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_sbmm.png", name: '设备名称', extra1: '', extra2: '', span1: 12, span2: 2}, //设备名称
],
serverInfoList: [],
userId: api.getPrefs({sync: true,key: 'userID'}),
token: api.getPrefs({sync: true,key: 'userToken'}),
devicePwd: '',
updateTime: '',
measureInfoListTemp: [
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dy.png", name: "A相相电压", value: "", unit: "V", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dy.png", name: "B相相电压", value: "", unit: "V", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dy.png", name: "C相相电压", value: "", unit: "V", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dy.png", name: "A相线电压", value: "", unit: "V", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dy.png", name: "B相线电压", value: "", unit: "V", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dy.png", name: "C相线电压", value: "", unit: "V", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dl.png", name: "A相电流", value: "", unit: "A", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dl.png", name: "B相电流", value: "", unit: "A", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dl.png", name: "C相电流", value: "", unit: "A", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_ld.png", name: "漏电电流", value: "", unit: "mA", offset: 2},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_pl.png", name: "频率", value: "", unit: "Hz", offset: 0},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_xlwd.png", name: "T1温度", value: "", unit: "℃", offset: 2},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_xlwd.png", name: "T2温度", value: "", unit: "℃", offset: 0},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_xlwd.png", name: "T3温度", value: "", unit: "℃", offset: 2},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_xlwd.png", name: "T4温度", value: "", unit: "℃", offset: 0},
// {img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_glys.png", name: "功率因素", value: "", unit: "", offset: 0},
// {img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_dn.png", name: "电能", value: "", unit: "kWh", offset: 2},
// {img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_wd.png", name: "温度2", value: "", unit: "℃", offset: 2},
// {img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_wd.png", name: "温度3", value: "", unit: "℃", offset: 0},
// {img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_wd.png", name: "温度4", value: "", unit: "℃", offset: 2},
],
measureInfoListTemp2: [
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_yggl.png", name: "A相有功功率", value: "", unit: "kW", offset: 0},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_yggl.png", name: "B相有功功率", value: "", unit: "kW", offset: 2},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_yggl.png", name: "C相有功功率", value: "", unit: "kW", offset: 0},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_yggl.png", name: "系统总有功功率", value: "", unit: "kW", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_wggl.png", name: "A相无功功率", value: "", unit: "kVar", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_wggl.png", name: "B相无功功率", value: "", unit: "kVar", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_wggl.png", name: "C相无功功率", value: "", unit: "kVar", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_wggl.png", name: "系统总无功功率", value: "", unit: "kVar", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_xtzszgl.png", name: "A相视在功率", value: "", unit: "kVA", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_xtzszgl.png", name: "B相视在功率", value: "", unit: "kVA", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_xtzszgl.png", name: "C相视在功率", value: "", unit: "kVA", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_xtzszgl.png", name: "系统总视在功率", value: "", unit: "kVA", offset: 2},
],
measureInfoListTemp3: [
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_glys.png", name: "A相功率因数", value: "", unit: "", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_glys.png", name: "B相功率因数", value: "", unit: "", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_glys.png", name: "C相功率因数", value: "", unit: "", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02001/icon_deviceInfo_glys.png", name: "系统功率因数", value: "", unit: "", offset: 2},
],
measureInfoListTemp4: [
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_zxygdn.png", name: "正向有功电能", value: "", unit: "kWh", offset: 0},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_zxwgdn.png", name: "正向无功电能", value: "", unit: "kVarh", offset: 2},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_fxygdn.png", name: "反向有功电能", value: "", unit: "kWh", offset: 0},
{img: "http://iot.uccc.cc:9090/product/03001/icon_deviceInfo_fxwgdn.png", name: "反向无功电能", value: "", unit: "kVarh", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_zdn.png", name: "总有功电能", value: "", unit: "kWh", offset: 0},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_zdn.png", name: "总无功电能", value: "", unit: "kVarh", offset: 2},
{img: "http://iot.uccc.cc:9090/product/02000/icon_deviceInfo_zdn.png", name: "总视在电能", value: "", unit: "kVah", offset: 0},
],
measureInfoList: [],
detailInfo: {},
info1: '测量信息',
info2: '功率信息',
info3: '功率因数',
info4: '电能信息',
userType: Number(api.getPrefs({sync: true,key: 'userType'})),
},
mounted() {
//window.chooseProduct = this.chooseProduct;
},
created() {
that = this
/** 下拉刷新 */
api.setRefreshHeaderInfo({
loadingImg:'widget://image/alpha0.png',
bgColor: '#5B7FF8',
textColor: 'rgba(255,255,255,0.5)',
textDown: '下拉刷新...',
textUp: '松开刷新...'
}, function(ret, err) {
that.initData1();
api.refreshHeaderLoadDone();
});
this.initData1()
// this.initData2()
},
filters: {
titleFilter(t) {
if (t != null) {
if (t.length > 10) {
return t.substring(0, 9) + "..."
}else {
return t
}
}else {
return '暂无'
}
}
},
methods: {
async initData1() {
const params = {
userId: this.userId,
imei: this.imei,
token: this.token
}
let deviceInfosRes = await get_device_infos_by_imei(params)
let deviceInfo = deviceInfosRes.data.device
this.detailInfo = eval("deviceInfo.store"+(deviceInfo.storeType.table))
console.log(JSON.stringify(this.detailInfo));
// 设备终端信息
if (deviceInfo.online) {
this.serverInfoListTemp[0].extra2 = 1
}
let bjztArr = this.detailInfo.alarm_type.split("")
bjztArr.forEach(d => {
if (d === "0") {
this.serverInfoListTemp[1].extra2 = 1
}
});
let gzztArr = this.detailInfo.auto_diagnosis.split("")
gzztArr.forEach(d => {
if (d === "0") {
this.serverInfoListTemp[2].extra2 = 1
}
});
console.log('---->>>' + this.detailInfo.status.split("")[11]);
if (this.detailInfo.status.split("")[11] === "0") {
this.serverInfoListTemp[3].extra2 = 1
}
if (this.detailInfo.status.split("")[10] === "0") {
this.serverInfoListTemp[4].extra2 = 1
}
if (this.detailInfo.status.split("")[9] === "0") {
this.serverInfoListTemp[5].extra2 = 1
}
if (this.detailInfo.status.split("")[8] === "0") {
this.serverInfoListTemp[6].extra2 = 1
}
this.devicePwd = deviceInfo.password
if (this.userType === 1) {
this.serverInfoListTemp[7] = {img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_sbwz.png", name: '设备位置', extra1: '', extra2: '', span1: 12, span2: 2}
this.serverInfoListTemp[7].extra1 = deviceInfo.bind.address
this.serverInfoListTemp[8] = {img: "http://iot.uccc.cc:9090/product/01001/sbmm.png", name: '设备密码', extra1: '修改设备密码', extra2: '', span1: 12, span2: 2}
this.serverInfoListTemp[9] = {img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_sbmm.png", name: '设备名称', extra1: '', extra2: '', span1: 12, span2: 2}
if (deviceInfo.bind.storename != null) {
this.serverInfoListTemp[9].extra1 = deviceInfo.bind.storename
}else {
this.serverInfoListTemp[9].extra1 = this.imei
}
}else {
this.serverInfoListTemp[7] = {img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_txlx.png", name: '通信类型', extra1: '', extra2: '', span1: 12, span2: 2}
this.serverInfoListTemp[8] = {img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_sbwz.png", name: '设备位置', extra1: '', extra2: '', span1: 12, span2: 2}
this.serverInfoListTemp[9] = {img: "http://iot.uccc.cc:9090/product/01001/icon_deviceInfo_ssxm.png", name: '所属项目', extra1: '', extra2: '', span1: 12, span2: 2}
this.serverInfoListTemp[7].extra1 = deviceInfo.nbmodel
this.serverInfoListTemp[8].extra1 = deviceInfo.location
this.serverInfoListTemp[9].extra1 = deviceInfo.groupName
}
this.updateTime = parseTime(deviceInfo.updatedAt,'{y}-{m}-{d} {h}:{i}:{s}')
let serverInfoTemp = this.serverInfoListTemp
// this.serverInfoListTemp.forEach((d, i) => {
// // 缓存图片
// let pic_url_ = api.getPrefs({sync: true,key: d.img})
// if (!pic_url_) {
// api.imageCache({
// url: d.img
// }, function(ret, err) {
// let url = ret.url;
// // $api.setStorage(d.img, url);
// api.setPrefs({
// key: d.img,
// value: url
// });
// serverInfoTemp[i].img = url
// });
// }else {
// serverInfoTemp[i].img = pic_url_
// }
// })
this.serverInfoList = serverInfoTemp
// 用户测量信息
this.measureInfoListTemp[0].value = this.detailInfo.uan
this.measureInfoListTemp[1].value = this.detailInfo.ubn
this.measureInfoListTemp[2].value = this.detailInfo.ucn
this.measureInfoListTemp[3].value = this.detailInfo.uab
this.measureInfoListTemp[4].value = this.detailInfo.ubc
this.measureInfoListTemp[5].value = this.detailInfo.uca
this.measureInfoListTemp[6].value = this.detailInfo.adl
this.measureInfoListTemp[7].value = this.detailInfo.bdl
this.measureInfoListTemp[8].value = this.detailInfo.cdl
this.measureInfoListTemp[9].value = this.detailInfo.ldl
this.measureInfoListTemp[10].value = this.detailInfo.syspl
this.measureInfoListTemp[11].value = this.detailInfo.t1wendu
this.measureInfoListTemp[12].value = this.detailInfo.t2wendu
this.measureInfoListTemp[13].value = this.detailInfo.t3wendu
this.measureInfoListTemp[14].value = this.detailInfo.t4wendu
// let measureInfoTemp = this.measureInfoListTemp
// console.log('+++' + this.detailInfo);
this.measureInfoListTemp2[0].value = this.detailInfo.ayggl
this.measureInfoListTemp2[1].value = this.detailInfo.byggl
this.measureInfoListTemp2[2].value = this.detailInfo.cyggl
this.measureInfoListTemp2[3].value = this.detailInfo.sysyggl
this.measureInfoListTemp2[4].value = this.detailInfo.awggl
this.measureInfoListTemp2[5].value = this.detailInfo.bwggl
this.measureInfoListTemp2[6].value = this.detailInfo.cwggl
this.measureInfoListTemp2[7].value = this.detailInfo.syswggl
this.measureInfoListTemp2[8].value = this.detailInfo.aszgl
this.measureInfoListTemp2[9].value = this.detailInfo.bszgl
this.measureInfoListTemp2[10].value = this.detailInfo.cszgl
this.measureInfoListTemp2[11].value = this.detailInfo.sysszgl
this.measureInfoListTemp3[0].value = this.detailInfo.aglys
this.measureInfoListTemp3[1].value = this.detailInfo.bglys
this.measureInfoListTemp3[2].value = this.detailInfo.cglys
this.measureInfoListTemp3[3].value = this.detailInfo.sysglys
this.measureInfoListTemp4[0].value = this.detailInfo.zxygdn
this.measureInfoListTemp4[1].value = this.detailInfo.zxwgdn
this.measureInfoListTemp4[2].value = this.detailInfo.fxygdn
this.measureInfoListTemp4[3].value = this.detailInfo.fxwgdn
this.measureInfoListTemp4[4].value = this.detailInfo.sysygdn
this.measureInfoListTemp4[5].value = this.detailInfo.syswgdn
this.measureInfoListTemp4[6].value = this.detailInfo.sysszdn
// this.measureInfoListTemp.forEach((d, i) => {
// // 缓存图片
// let pic_url_ = api.getPrefs({sync: true,key: d.img})
// if (!pic_url_) {
// api.imageCache({
// url: d.img
// }, function(ret, err) {
// let url = ret.url;
// // $api.setStorage(d.img, url);
// api.setPrefs({
// key: d.img,
// value: url
// });
// measureInfoTemp[i].img = url
// });
// }else {
// measureInfoTemp[i].img = pic_url_
// }
// })
// this.measureInfoList = measureInfoTemp
},
editServerInfo(index) {
if (this.userType === 1) {
switch (index) {
case 7: //position
this.changePosition()
break;
case 8: //resetPwd
this.resetDevice()
break;
case 9: //devicename
this.changeDeviceName()
break;
default:
break;
}
}
},
resetDevice() {
let curPwd = this.devicePwd
if (curPwd == null) {
inputDialogJSON.texts.title = "此设备未设置过密码!"
}else {
inputDialogJSON.texts.title = "原密码:" + curPwd
}
inputDialogJSON.texts.placeholder = "请输入新密码"
inputDialogJSON.styles.title.color = '#37394E'
let dialogBox = api.require('dialogBox')
dialogBox.input(inputDialogJSON, async function(ret) {
if (ret.eventType == 'left') {
var dialogBox = api.require('dialogBox');
dialogBox.close({
dialogName: 'input'
});
}else if (ret.eventType == "right") {
if (curPwd == null) {
api.toast({msg: '该设备无法设置密码!'});
return;
}
let regularRes = /^\d+$/.test(ret.text);
if (regularRes && ret.text.length <= 6 && ret.text.length > 0) {
let updatePwdParams = {
token: api.getPrefs({sync: true,key: 'userToken'}),
old_pwd: curPwd,
new_pwd: ret.text,
imei: that.imei
}
let updatePwdRes = await post_update_device_pwd(updatePwdParams)
console.log(JSON.stringify(updatePwdRes));
if ( updatePwdRes.code == 0 ) {
var dialogBox = api.require('dialogBox');
dialogBox.close({
dialogName: 'input'
});
that.initData1()
api.toast({msg: '设备密码已重置!'});
}else {
api.toast({
msg: "更新失败," + ajaxCodeCheck(ret.code, ret.msg, '请稍后再试')
});
}
}else {
api.toast({msg: '请输入6位以内数字'});
return;
}
}
});
},
changePosition() {
api.prompt({
title: '修改设备地址',
text: this.serverInfoList[7].extra1,
buttons: ['取消', '确定']
},async function(ret, err) {
var index = ret.buttonIndex;
var text = ret.text;
if (index == 2) {
if (text.length <= 15 && text != '') {
let params = {
imei: that.imei,
user_id: that.userId,
address: text
}
let handleRes = await post_modify_device_info(that.token, params)
if (handleRes.code === 0) {
api.toast({msg: '修改成功'});
that.initData1()
}else {
api.toast({msg: '修改失败'});
}
}else if (text == '') {
api.toast({msg: '设备名称不可为空'});
}else if (text.length > 15) {
api.toast({msg: '设备名称最多15个字符!'});
}
}
});
},
changeDeviceName() {
api.prompt({
title: '修改设备名称',
text: this.serverInfoList[9].extra1,
buttons: ['取消', '确定']
},async function(ret, err) {
var index = ret.buttonIndex;
var text = ret.text;
if (index == 2) {
if (text.length <= 15 && text != '') {
let params = {
imei: that.imei,
user_id: that.userId,
store_name: text
}
let handleRes = await post_modify_device_info(that.token, params)
if (handleRes.code === 0) {
api.toast({msg: '修改成功'});
that.initData1()
}else {
api.toast({msg: '修改失败'});
}
}else if (text == '') {
api.toast({msg: '设备名称不可为空'});
}else if (text.length > 15) {
api.toast({msg: '设备名称最多15个字符!'});
}
}
});
}
}
})
};
</script>
</html>