index_frm.html
34.4 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
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
<!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>03001首页_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;
}
</style>
</head>
<body ontouchstart="" οnmοuseοver="">
<div id="app">
<template>
<div class="store01001-panel-and-count">
<div class="store01001-panel-area">
<div class="store01001-device-name">{{ deviceName }}</div>
<div class="store01001-device-imei">{{ deviceImei }}</div>
<!--aui-hide-->
<div class="store01001-status-list">
<div class="aui-row aui-row-flex">
<div class="aui-col aui-col-span-7 aui-row-flex-center aui-row-flex-middle" style="height:111px;">
<div class="store01001-device-state">
<div class="store01001-cur-state-value">
<span v-if="deviceInfo.online">在线</span>
<span v-else>离线</span>
</div>
<div class="store01001-short-line"></div>
<div class="store01001-state-title">状态</div>
</div>
</div>
<div class="aui-col aui-col-span-10 aui-row-flex-center aui-row-flex-middle" style="height:111px;">
<img src="http://iot.uccc.cc:9090/product/03005/image-ty-620-1P.png" style="height:100%;" />
</div>
<div class="aui-col aui-col-span-7 aui-row-flex-center aui-row-flex-middle" style="height:111px;">
<div class="store01001-device-state">
<div class="store01001-cur-state-value" id="cur_state2">
<span>{{ deviceInfo | statusFilter }}</span>
</div>
<div class="store01001-short-line"></div>
<div class="store01001-state-title">开关</div>
</div>
</div>
</div>
</div>
<div class="store01001-panel-count">
<el-row>
<!-- <el-col :span=1 style="height:72px;"> </el-col> -->
<div v-for="(d, i) in indexBtns">
<el-col :span=d.span style="height:72px;" >
<el-row tapmode @click.native="selectBtn(i)">
<el-col :span=24 style="margin-top:0.5rem;">
<div v-if="i === 2 && warningCount != 0" class="aui-badge">{{ warningCount }}</div>
<div v-if="i === 3 && faultCount != 0" class="aui-badge">{{ faultCount }}</div>
<img :src=d.img :id="'cache_btns_'+ i" style="margin: 0 auto;" />
</el-col>
<el-col :span=24>
<p class="store01001-btn-name">{{ d.name }}</p>
</el-col>
</el-row>
</el-col>
</div>
</el-row>
</div>
</div>
</div>
<div class="store01001-info-title1">
<el-row>
<el-col :span=12 >
<span>{{ operateTitle }}</span>
</el-col>
<el-col :span=12 tapmode @click.native="showLogs">
<span style="font-size:14px;float: right;">开关状态日志<i class="aui-iconfont aui-icon-right"></i></span>
<!-- <span style="font-size:14px;float: right;">操作记录<i class="aui-iconfont aui-icon-right"></i></span> -->
</el-col>
</el-row>
<el-row>
<div v-for="(list_d, list_i) in operateList1">
<el-col :span=8 style="margin-top: 10px;">
<div class="operation-panel" style="margin-right:5px;height: 110px;">
<div style="margin-left:15px;margin-right:15px;margin-bottom:10px;">
<div class="aui-row aui-row-flex">
<div class="aui-col aui-col-span-24 aui-row-flex-start" style="margin-top:12.5px;margin-bottom:10px;">
<img :src="list_d.url" style="height:44px;width:44px;margin: 0 auto;">
</div>
<div class="aui-col aui-col-span-24">
<div class="operation-btn" style="width: 3.5rem;margin: 0 auto;" :id="'btn_'+ (list_i+1)" tapmode @click="deviceOperation(list_i+1, list_d.name ,'ctr', list_d.command);"><span :id="'loading'+ (list_i+1)" style="text-align: center;"> {{ list_d.name }}</span></div>
</div>
</div>
</div>
</div>
</el-col>
</div>
<div v-for="(list_d, list_i) in operateList2">
<el-col :span=12 style="margin-top: 10px;">
<div class="operation-panel" style="margin-right:5px;">
<div style="margin-left:15px;margin-right:15px;margin-bottom:10px;">
<div class="aui-row aui-row-flex">
<div class="aui-col aui-col-span-12 aui-row-flex-start" style="margin-top:12.5px;">
<img :src="list_d.url" style="height:44px;width:44px;margin: 0 auto;">
</div>
<div class="aui-col aui-col-span-12 aui-row-flex-end" >
<div class="operation-btn" style="width: 3.5rem;" :id="'btn_'+ (list_i+4)" tapmode @click="deviceOperation(list_i+4, list_d.name ,'ctr', list_d.command);"><span :id="'loading'+ (list_i+4)"> {{ list_d.name }}</span></div>
</div>
</div>
</div>
</div>
</el-col>
</div>
</el-row>
</div>
<div class="store01001-info-title1">
<el-row>
<el-col :span=12 >
<span>{{ energyTitle }}</span>
</el-col>
<el-col :span=12 tapmode @click.native="showStatistics">
<span style="font-size:14px;float: right;">能耗分析<i class="aui-iconfont aui-icon-right"></i></span>
</el-col>
</el-row>
<el-row>
<el-col :span=11>
<div class="store02001-energy-area">
<div class="store02001-energy-inside-area">
<span>{{ dnToday }}</span>
<p>当日用电量(kWh)</p>
</div>
</div>
</el-col>
<el-col :span=2> </el-col>
<el-col :span=11>
<div class="store02001-energy-area">
<div class="store02001-energy-inside-area">
<span>{{ dnYestday }}</span>
<p>昨日用电量(kWh)</p>
</div>
</div>
</el-col>
</el-row>
</div>
<div id="chart_area">
<div class="store01001-info-title2">{{ measureTitle }}</div>
<div style="margin-top: 15px;margin-left: 15.5px;margin-right: 14.5px;">
<el-collapse v-model="activeName" accordion @change="collapseChange">
<el-collapse-item name="1">
<template slot="title">
<span class="device-type-title">当前测量:{{ curMeasure }}</span>
</template>
<div class="aui-margin-l-15 aui-margin-r-15" v-for="(list_d, list_i) in measureList">
<el-divider content-position="left">{{ list_d.name }}</el-divider>
<div class="product-info">
<el-row :gutter="10">
<div v-for="(measure_d, measure_i) in measureList[list_i].values">
<el-col :span=measure_d.span style="margin-bottom: 10px;">
<span class="product-select-normal" style="height: 1.5rem;line-height: 1.5rem;font-size:0.6rem;padding-left: 0.3rem;padding-right: 0.3rem;" @click="chooseMeasureType(measure_d)">{{ measure_d.buttonTitle }}</span>
</el-col>
</div>
</el-row>
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
<div class="store01001-chart-panel">
<div style="padding-left:10px;padding-right:10px;padding-bottom:10px;">
<div style="height:1px;background:rgba(240,245,255,1);margin-top: 6px;margin-bottom:5px;"></div>
<div class="tab-view-list" id="echarts_view" style="height:11.5rem;">
</div>
<div style="height:10px;"></div>
</div>
</div>
</div>
<div style="height:30px;width:auto"></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" src="http://iot.uccc.cc:9090/app/js/aui-popup-wjb.js" ></script>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/echarts.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/ctrl.js"></script>
<script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/md5.js"></script>
<script type="text/javascript">
var vm,
popup,
that,
inputDialogJSON;
apiready = function(){
api.parseTapmode();
inputDialogJSON = returnInputDialogJSON()
$(function() {
FastClick.attach(document.body);
});
//---------初始化vue
vm = new Vue({
el: '#app',
data: {
deviceInfo: api.pageParam.deviceInfo,
deviceImei: api.pageParam.imei,
deviceName: '',
token: api.getPrefs({sync: true,key: 'userToken'}),
user_id: api.getPrefs({sync: true,key: 'userID'}),
indexBtns: [
],
indexBtnsTemp: [
{img: 'http://iot.uccc.cc:9090/product/02001/home_icon_menu01.png', name: '设备信息', span: 5},
{img: 'http://iot.uccc.cc:9090/product/02001/home_icon_menu06.png', name: '操作命令', span: 5},
{img: 'http://iot.uccc.cc:9090/product/02001/home_icon_menu03.png', name: '报警信息', span: 4},
{img: 'http://iot.uccc.cc:9090/product/02001/home_icon_menu02.png', name: '故障信息', span: 5},
{img: 'http://iot.uccc.cc:9090/product/02001/home_icon_menu04.png', name: '统计分析', span: 5},
],
operateTitle: "远程操作",
energyTitle: "能耗统计",
measureTitle: "测量信息",
curMeasure: "电流",
measureList: [
{
name: "测量信息",
values: [{buttonTitle: "电流", buttonValue: "r_xdl1", buttonUnit: "A", span: 8},
{buttonTitle: "电压", buttonValue: "r_xdy1", buttonUnit: "V", span: 8},
{buttonTitle: "漏电", buttonValue: "r_loudian", buttonUnit: "mA", span: 8},
{buttonTitle: "频率", buttonValue: "r_plcl", buttonUnit: "Hz", span: 8},
{buttonTitle: "线缆温度", buttonValue: "r_axmpwendu", buttonUnit: "℃", span: 8},
]
},
{
name: "功率信息",
values: [
{buttonTitle: "有功功率", buttonValue: "r_axygglcl", buttonUnit: "W", span: 7},
{buttonTitle: "总视在功率", buttonValue: "r_hxszgl", buttonUnit: "VA", span: 9},
{buttonTitle: "无功功率", buttonValue: "r_axwgglcl", buttonUnit: "Var", span: 8},
]
},
{
name: "功率因数",
values: [
{buttonTitle: "功率因数", buttonValue: "r_axglyz", buttonUnit: "", span: 6},
]
},
{
name: "电能信息",
values: [
{buttonTitle: "正向有功电能", buttonValue: "r_zxygdn", buttonUnit: "kWh", span: 8},
{buttonTitle: "正向无功电能", buttonValue: "r_zxwgdn", buttonUnit: "KVarH", span: 8},
{buttonTitle: "反向有功电能", buttonValue: "r_fxygdn", buttonUnit: "kWh", span: 8},
{buttonTitle: "反向无功电能", buttonValue: "r_fxwgdn", buttonUnit: "KVarH", span: 8},
]
},
{
name: "外部电量采集信息",
values: [
{buttonTitle: "脉冲电能", buttonValue: "rw_mcdn", buttonUnit: "kWh", span: 8},
// {buttonTitle: "脉冲计数个数", buttonValue: "rw_dnmcnumzd", buttonUnit: "", span: 8},
]
},
{
name: "拉弧测量",
values: [
{buttonTitle: "拉弧值", buttonValue: "r_axlhz", buttonUnit: "A", span: 5},
]
},
],
userId: api.getPrefs({sync: true,key: 'userID'}),
token: api.getPrefs({sync: true,key: 'userToken'}),
warningCount: 0,
faultCount: 0,
dnYestday: 0.00,
dnToday: 0.00,
operateList1: [
{
name: "分闸",
url: "http://iot.uccc.cc:9090/product/01001/lazha.png",
command: "OPEN_GATE"
},
{
name: "合闸",
url: "http://iot.uccc.cc:9090/product/03001/icon_remoteOperation_hz.png",
command: "CLOSE_GATE"
},
{
name: "漏电自检",
url: "http://iot.uccc.cc:9090/product/03001/icon_remoteOperation_ldzj_sm.png",
command: "SELF_CHECK"
},
],
operateList2: [
{
name: "远程解锁",
url: "http://iot.uccc.cc:9090/product/03001/icon_remoteOperation_ycjs_sm.png",
command: "UNLOCK"
},
{
name: "远程自锁",
url: "http://iot.uccc.cc:9090/product/03001/icon_remoteOperation_yczs_sm.png",
command: "LOCK"
},
],
activeName: '',
userType: Number(api.getPrefs({sync: true,key: 'userType'})),
},
mounted() {
//window.chooseProduct = this.chooseProduct;
},
filters: {
statusFilter(v) {
let statusArr = v.store03001.switch
if ( !statusArr ) {
return "分闸"
}else {
return "合闸"
}
}
},
created() {
this.initBtns()
that = this
setTimeout(() => {
this.chooseMeasureType({buttonTitle: "电流",buttonValue: "r_xdl1",buttonUnit: "A",span:4})
}, 1000);
api.addEventListener({
name: 'reloadIndex'
}, function(ret, err){
that.initBtns();
});
api.addEventListener({
name: 'pageDownEvent'
}, function(ret, err){
setTimeout(() => {
api.pageDown(function(ret, err) {
if (!ret.scrolled) {
//已经滚动到底部
}
});
}, 500);
});
/** 下拉刷新 */
api.setRefreshHeaderInfo({
loadingImg:'widget://image/alpha0.png',
bgColor: '#529AF3',
textColor: 'rgba(255,255,255,0.5)',
textDown: '下拉刷新...',
textUp: '松开刷新...'
}, function(ret, err) {
that.initBtns();
api.refreshHeaderLoadDone();
});
// setTimeout(() => {
// this.selectBtn(0)
// }, 1000);
},
methods: {
collapseChange(val) {
if (val === '1') {
api.sendEvent({
name: 'pageDownEvent',
});
api.setFrameAttr({
name: 'store_03001_indexFrm',
bounces: false,
});
}else if (val === '') {
api.setFrameAttr({
name: 'store_03001_indexFrm',
bounces: true,
});
this.activeName = ''
}
},
async deviceOperation(index,name,cmd,val) {
const params = {
imei: api.pageParam.imei,
userId: api.getPrefs({sync: true,key: 'userID'}),
token: that.token,
}
let infos = await get_device_infos_by_imei(params)
let currentStatus = infos.data.device.store03001.r_current_status
if (currentStatus.substring(15,16) == '0' && currentStatus.substring(4,8) == '0000') {
var dialogBox = api.require('dialogBox');
dialogBox.alert(alertJson('警告', '当前设备为手动分闸状态,如需继续操作,\n请务必确认设备现场情况,\n如:是否有人在维护设备\n'), function(ret) {
if (ret.eventType == 'left') {
var dialogBox = api.require('dialogBox');
dialogBox.close({
dialogName: 'alert'
});
setTimeout(() => {
that.handleDevice(index,name,cmd,val, params)
}, 500);
}
});
}else {
that.handleDevice(index,name,cmd,val, params)
}
},
async handleDevice(index,name,cmd,val, params) {
let dialogBox = api.require('dialogBox')
let dom = $api.byId('btn_'+index);
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 (!that.deviceInfo.online) {
api.toast({msg: '该设备不在线无法操作!',duration: 2000,location: 'bottom'});
return;
}
let deviceInfos = await get_device_infos_by_imei(params)
let pass = false
if (that.userType === 1) {
deviceInfos.data.device.password === ret.text ? pass = true : pass = false
}else if (that.userType === 2) {
deviceInfos.data.device.password === md5(ret.text) ? pass = true : pass = false
}
if (pass) {
//handle operate...
var dialogBox = api.require('dialogBox');
dialogBox.close({
dialogName: 'input'
});
var spanDom = $api.byId('loading'+index);
$api.html(spanDom, '');
$api.addCls(dom, 'store01001-operate-operation-doing'); //缩放效果,改变宽度
$api.addCls(dom, 'store01001-operate-not-click'); //不可点击
$api.addCls(spanDom, 'aui-loading'); //加gif
console.log(JSON.stringify({
user_id: that.userId,
imei: api.pageParam.imei,
type: that.deviceInfo.storeType.table,
command: cmd,
control_name: val,
}));
$.ajax({
url: HOST + '/iot_api/v2/app/tyControl',
type: 'POST',
dataType: 'json',
headers:{
'Content-Type':'application/json;charset=utf-8',
'token': that.token
},
data: JSON.stringify({
user_id: that.user_id,
imei: api.pageParam.imei,
type: that.deviceInfo.storeType.table,
command: cmd,
control_name: val,
}),
complete: function() {
api.hideProgress();
},
success: function(ret) {
console.log(JSON.stringify(ret));
setTimeout(function(){
$api.html(spanDom, name);
$api.removeCls(dom, 'store01001-operate-operation-doing');
$api.removeCls(dom, 'store01001-operate-not-click');
$api.removeCls(spanDom, 'aui-loading');
if (ret.data.upRet) {
let upRet = JSON.parse(ret.data.upRet)
if (ret.code == 0 && ret.msg == '操作成功' && upRet.rescode == 200) {
api.toast({
msg: '操作' + name + '成功',
duration: 2000,
location: 'bottom'
});
}else {
api.toast({
msg: '操作' + name + '失败',
duration: 2000,
location: 'bottom'
});
}
}
}, 1000);
},
error: function() {
api.toast({
msg: '操作' + name + '失败',
duration: 2000,
location: 'bottom'
});
}
});
}else {
api.toast({msg: '设备密码错误!',duration: 2000,location: 'bottom'});
}
}
});
},
async initBtns() {
let params = {
imei: this.deviceImei,
userId: this.userId,
token: this.token
}
let lastInfoRes = await get_device_infos_by_imei(params)
let lastInfo = lastInfoRes.data.device
this.deviceInfo = lastInfo
if(lastInfo.store03001.r_func_choice.substr(12,1) === '1') {
this.measureList[0].values.push({buttonTitle: "环境温度", buttonValue: "r_envir_temp", buttonUnit: "℃", span: 8})
}
this.warningCount = lastInfo.warning_count
if (this.userType === 1) {
this.deviceName = filterDeviceName(lastInfo.bind.storename, api.pageParam.imei)
}else if (this.userType === 2) {
this.deviceName = filterDeviceName(lastInfo.name, api.pageParam.imei)
}
this.faultCount = lastInfo.fault_count
let btnTemp = this.indexBtnsTemp
this.indexBtns = btnTemp
let yestday = parseTime(new Date(new Date().getTime() - 24*60*60*1000),'{y}-{m}-{d}')
let today = parseTime(new Date(),'{y}-{m}-{d}')
let _params = {
day1: today,
day2: yestday,
imei: this.deviceImei,
}
let eneryStaticRes = await get_energy_static_by_day(_params)
let eneryList = eneryStaticRes.data.List
eneryList.forEach(d => {
if (yestday === d.day && this.deviceImei === d.imei) {
this.dnYestday = d.total.toFixed(2)
}else if (today === d.day && this.deviceImei === d.imei) {
this.dnToday = d.total.toFixed(2)
}
});
},
async chooseMeasureType(ret) { //
this.collapseChange('')
this.curMeasure = ret.buttonTitle
const params = {
imei: this.deviceImei,
token: this.token,
chartType: ret.buttonValue
}
var echartDom = document.getElementById("echarts_view");
let dailyRes = await get_normal_daily_chart(params)
if (dailyRes.success == 1) {
var myChart = echarts.init(echartDom);
var option = {
title: {
left: 'center',
text: ret.buttonTitle+'趋势变化图',
},
grid: {
// top: 50,
x: 45,
x2: 20,
y: 50,
},
tooltip: {
trigger: 'axis',
position: 'top',
formatter: function (params) {
params = params[0];
return params.axisValue+'<br />'+params.marker+params.seriesName+'值 '+params.data+ ret.buttonUnit;
},
},
xAxis: {
type: 'category',
boundaryGap: false,
data: dailyRes.data.xdata.map(function(item){
return item.substring(11,16)
}),
axisLine: {
lineStyle: {
color: '#B0C8FF'
}
},
axisLabel: {
textStyle: {
color: function (value, index) {
return '#818295';
}
},
rotate:330
}
},
yAxis: {
type: 'value',
boundaryGap: [0, '100%'],
//y轴颜色
axisLine: {
lineStyle: {
color: '#fff'
}
},
axisLabel: {
formatter: '{value}'+ ret.buttonUnit,
textStyle: {
color: function (value, index) {
return value >= 0 ? '#818295' : 'red';
}
},
interval: 0,//让所有坐标值全部显示
rotate:30,//让坐标值旋转一定的角度
},
splitLine:{
show:true ,
lineStyle:{
color:'#F0F5FF',
width: 1
}
}
},
dataZoom: [
{
type: 'slider',
fillerColor: '#B0C8FF',
backgroundColor: '#F0F5FF',
start: 0,
end: 100,
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '90%',
handleStyle: {
color: '#5B7FF8',
},
dataBackground:{
lineStyle:{
color:'#B0C8FF'
},
areaStyle:{
color:'#F0F5FF',
opacity:1,
}
},
bottom:'0%'
},{
type: 'inside',//这个 dataZoom 组件是 inside 型 dataZoom 组件(能在坐标系内进行拖动,以及用滚轮(或移动触屏上的两指滑动)进行缩放)
xAxisIndex: 0,//控制x轴
}
],
series: [{
data: dailyRes.data.ydata[ret.buttonValue],
name: ret.buttonTitle,
type:'line',
showSymbol: true,
hoverAnimation: false,
symbol: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',
symbolSize: 8,
// 折线颜色
itemStyle: {
normal: {
color: '#5B7FF8',
lineStyle: {
color: '#5B7FF8'
}
}
},
}]
};
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
}
},
//这里以后全部是配置对应的http地址...
selectBtn(index) {
let params = {productId: api.pageParam.productId,
imei: api.pageParam.imei}
switch (index) {
case 0:
api.openWin({
name: 'deviceDetails_win',
// url: 'http://iot.uccc.cc:9090/app_html/store03001/device_details_win.html',
url: './device_details_win.html',
bounces: true,
pageParam: params
});
break;
case 1:
params.pwd = this.deviceInfo.password
api.openWin({
name: 'deviceOperate_win',
// url: 'http://iot.uccc.cc:9090/app_html/store03001/device_operate_win.html',
url: './device_operate_win.html',
bounces: false,
pageParam: params
});
break;
case 2:
api.openWin({
name: 'alarmInfo_win',
url: 'http://iot.uccc.cc:9090/app_html/store03001/alarm_info_win.html',
// url: './alarm_info_win.html',
bounces: false,
pageParam: params
});
break;
case 3:
api.openWin({
name: 'fault_win',
url: 'http://iot.uccc.cc:9090/app_html/store03001/fault_info_win.html',
// url: './fault_info_win.html',
bounces: false,
pageParam: params
});
break;
case 4:
api.openWin({
name: 'statistic_win',
url: 'http://iot.uccc.cc:9090/app_html/store03001/statistic_win.html',
// url: './statistic_win.html',
bounces: false,
pageParam: params
});
break;
default:
break;
}
},
showStatistics() {
// addAlert("努力开发中...");
api.openWin({
name: 'energy_statistics_win',
url: 'http://iot.uccc.cc:9090/app_html/store02001/energy_statistics_win.html',
// url: './energy_statistics_win.html',
slidBackEnabled: false,
pageParam: {
productId: api.pageParam.productId,
imei: api.pageParam.imei
}
});
},
showLogs() {
let params = {productId: api.pageParam.productId,
imei: api.pageParam.imei}
api.openWin({
name: 'deviceOperate_win',
url: 'http://iot.uccc.cc:9090/app_html/store03001/operate_record_win.html',
// url: './operate_record_win.html',
bounces: false,
slidBackEnabled: false,
pageParam: params
});
}
}
})
};
</script>
</html>