YYC
2025-05-15 2df906a447195f9786dd468512ea895d6cc18532
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
var deviceData;
var deptId; //库区编码
var depotId; //仓库编码
var frontList = []; //仓库正面设备列表
var backList = []; //仓库反面设备列表
var leftList = []; //仓库左侧面设备列表
var rightList = []; //仓库右侧面设备列表
var deviceDetail = {
    "passCode": "",
    "serId": "",
    "location": "",
    "type": "",
    "status": ""
}
//设备控制
var data = {
    "interfaceId": "5402",
    "outId": "10402",
    "reqDateTime": new Date(),
    "tokenAuth": "",
    "data": {
        "deptId": "",
        "depotId": "",
        "type": "",
        "passCode": "",
        "serId": "",
        "targetStatus": "",
        "batchTag":""
    }
};
//设备列表
var data1 = {
    "interfaceId": "5401",
    "outId": "10401",
    "reqDateTime": new Date(),
    "tokenAuth": "",
    "data": {
        "deptId": "",
        "depotId": "",
        "type": "01", //风窗
        "type1": "02", //轴流风窗
        "type2": "04", //环流风机
        "type3": "0B", //通风口
        "type4": "0C", //混流风口
        "type5": "0D", //加压风机
    }
};
 
function init() {
 
    var user = JSON.parse(localStorage.getItem('user'));
    var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId'));
    url = user.url + "/api/phone/v35/gateway";
    data.tokenAuth = user.tokenAuth;
    data.data.deptId = user.deptId;
    data1.data.deptId = user.deptId;
    data1.tokenAuth = user.tokenAuth;
    deptId = user.deptId;
    //获取从上一个页面传递的数据
    var self = plus.webview.currentWebview();
    data.data.depotId = self.depotId
    data1.data.depotId = self.depotId
    depotId = self.depotId
    console.log(depotId)
    // depotType = self.depotType
    // depotName = self.depotName
    getDeviceList();
}
 
//获取设备列表(通风)
function getDeviceList() {
    mui.ajax(url, {
        type: "POST",
        dataType: "json",
        crossDomain: true,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify(data1),
        success: function(result) {
            if (result.code == "0000") {
                deviceData = result.data;
                renderDevice();
            } else {
                mui.toast(result.msg);
                renderDevice();
            }
        },
        error: function() {
            mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div")
        }
    })
}
 
//渲染页面
function renderDevice() {
    var html = '';
    if (deviceData) {
        var deviceList = deviceData.listDevice;
        if (deviceList && deviceList.length > 0) {
            frontList=[];
            backList=[];
            leftList=[];
            rightList=[];
            $.each(deviceList, function(index, item) {
                if (item.location == '01') {
                    frontList.push(item)
                } else if (item.location == '02') {
                    backList.push(item)
                } else if (item.location == '03') {
                    leftList.push(item)
                } else if (item.location == '04') {
                    rightList.push(item)
                }
            })
            if (frontList && frontList.length > 0) { //仓库正面
                html += '<div class="m-tf"><div class="g-tittf1">仓库正面</div><ul class="ul-listmana1 ullisttf1">';
                $.each(frontList, function(index, item) {
                    targetStatus = item.status
                    if (item.type == '01') { //风窗
                        html += '<li><div class="con myfancy chuangkou" status="' + item.status +
                            '" passCode="' + item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front" type="01">';
                        if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
                            html += '<div class="info in" style="background-image: url(images/e5.png);">'+ item.name +'</div>'
                        }else if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_01_CLOSE.png"></div>'
                            html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
                        }
                        html += '</div></li>'
                    } else if (item.type == '02') { //轴流风机
                        html += '<li><div class="con myfancy zhouliu" status="'+ item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front">';
                        if(targetStatus == 'W_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_CLOSE.png"></div>'
                        }else if(targetStatus == 'W_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
                        }else if(targetStatus == 'F_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN.gif"></div>'
                        }else if(targetStatus == 'F_OPEN_F'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN_F.gif"></div>'
                        }else if(targetStatus == 'F_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
                        }
                        html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name +'</div>'
                        html += '</div></li>'
                    } else if (item.type == '04') { //环流风机
                        html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_04_ClOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_04_OPEN.gif"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    } else if (item.type == '0B') { //通风口
                        html += '<li><div class="con myfancy chuangkou" status="' + item.status +
                            '" passCode="' +item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front" type="0B">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0B_CLOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
                        }
                        html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
                        html += '</div></li>'
                    } else if (item.type == '0C') { //混流风机
                        html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
                        if(targetStatus == 'W_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_w_CLOSE.png"></div>'
                        }else if(targetStatus == 'F_OPEN_F'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN_F.gif"></div>'
                        }else if(targetStatus == 'F_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN.gif"></div>'
                        }else if(targetStatus == 'W_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_W_OPEN.png"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    } else if (item.type == '0D') { //加压风机
                        html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_CLOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_OPEN.png"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    }
                })
                html += '</ul></div>'
            } 
            if (backList && backList.length > 0) { //仓库反面
                html += '<div class="m-tf"><div class="g-tittf1">仓库反面</div><ul class="ul-listmana1 ullisttf1">';
                $.each(frontList, function(index, item) {
                    targetStatus = item.status
                    if (item.type == '01') { //风窗
                        html += '<li><div class="con myfancy chuangkou" status="' + item.status +
                            '" passCode="' + item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front" type="01">';
                        if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
                            html += '<div class="info in" style="background-image: url(images/e5.png);">'+ item.name +'</div>'
                        }else if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_01_CLOSE.png"></div>'
                            html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
                        }
                        html += '</div></li>'
                    } else if (item.type == '02') { //轴流风机
                        html += '<li><div class="con myfancy zhouliu" status="'+ item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front">';
                        if(targetStatus == 'W_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_CLOSE.png"></div>'
                        }else if(targetStatus == 'W_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
                        }else if(targetStatus == 'F_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN.gif"></div>'
                        }else if(targetStatus == 'F_OPEN_F'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN_F.gif"></div>'
                        }else if(targetStatus == 'F_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
                        }
                        html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name +'</div>'
                        html += '</div></li>'
                    } else if (item.type == '04') { //环流风机
                        html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_04_ClOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_04_OPEN.gif"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    } else if (item.type == '0B') { //通风口
                        html += '<li><div class="con myfancy chuangkou" status="' + item.status +
                            '" passCode="' +item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front" type="0B">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0B_CLOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
                        }
                        html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
                        html += '</div></li>'
                    } else if (item.type == '0C') { //混流风机
                        html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
                        if(targetStatus == 'W_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_w_CLOSE.png"></div>'
                        }else if(targetStatus == 'F_OPEN_F'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN_F.gif"></div>'
                        }else if(targetStatus == 'F_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN.gif"></div>'
                        }else if(targetStatus == 'W_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_W_OPEN.png"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    } else if (item.type == '0D') { //加压风机
                        html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_CLOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_OPEN.png"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    }
                })
                html += '</ul></div>'
            } 
            if (leftList && leftList.length > 0) { //仓库左侧面
                html += '<div class="m-tf"><div class="g-tittf1">仓库左侧面</div><ul class="ul-listmana1 ullisttf1">';
                $.each(frontList, function(index, item) {
                    targetStatus = item.status
                    if (item.type == '01') { //风窗
                        html += '<li><div class="con myfancy chuangkou" status="' + item.status +
                            '" passCode="' + item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front" type="01">';
                        if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
                            html += '<div class="info in" style="background-image: url(images/e5.png);">'+ item.name +'</div>'
                        }else if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_01_CLOSE.png"></div>'
                            html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
                        }
                        html += '</div></li>'
                    } else if (item.type == '02') { //轴流风机
                        html += '<li><div class="con myfancy zhouliu" status="'+ item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front">';
                        if(targetStatus == 'W_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_CLOSE.png"></div>'
                        }else if(targetStatus == 'W_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
                        }else if(targetStatus == 'F_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN.gif"></div>'
                        }else if(targetStatus == 'F_OPEN_F'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN_F.gif"></div>'
                        }else if(targetStatus == 'F_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
                        }
                        html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name +'</div>'
                        html += '</div></li>'
                    } else if (item.type == '04') { //环流风机
                        html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_04_ClOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_04_OPEN.gif"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    } else if (item.type == '0B') { //通风口
                        html += '<li><div class="con myfancy chuangkou" status="' + item.status +
                            '" passCode="' +item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front" type="0B">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0B_CLOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
                        }
                        html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
                        html += '</div></li>'
                    } else if (item.type == '0C') { //混流风机
                        html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
                        if(targetStatus == 'W_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_w_CLOSE.png"></div>'
                        }else if(targetStatus == 'F_OPEN_F'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN_F.gif"></div>'
                        }else if(targetStatus == 'F_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN.gif"></div>'
                        }else if(targetStatus == 'W_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_W_OPEN.png"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    } else if (item.type == '0D') { //加压风机
                        html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_CLOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_OPEN.png"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    }
                })
                html += '</ul></div>'
            } 
             if (rightList && rightList.length > 0) { //仓库右侧面
                html += '<div class="m-tf"><div class="g-tittf1">仓库右侧面</div><ul class="ul-listmana1 ullisttf1">';
                $.each(frontList, function(index, item) {
                    targetStatus = item.status
                    if (item.type == '01') { //风窗
                        html += '<li><div class="con myfancy chuangkou" status="' + item.status +
                            '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front" type="01">';
                        if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
                            html += '<div class="info in" style="background-image: url(images/e5.png);">'+ item.name +'</div>'
                        }else if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_01_CLOSE.png"></div>'
                            html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
                        }
                        html += '</div></li>'
                    } else if (item.type == '02') { //轴流风机
                        html += '<li><div class="con myfancy zhouliu" status="'+ item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front">';
                        if(targetStatus == 'W_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_CLOSE.png"></div>'
                        }else if(targetStatus == 'W_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
                        }else if(targetStatus == 'F_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN.gif"></div>'
                        }else if(targetStatus == 'F_OPEN_F'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN_F.gif"></div>'
                        }else if(targetStatus == 'F_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
                        }
                        html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name +'</div>'
                        html += '</div></li>'
                    } else if (item.type == '04') { //环流风机
                        html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_04_ClOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_04_OPEN.gif"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    } else if (item.type == '0B') { //通风口
                        html += '<li><div class="con myfancy chuangkou" status="' + item.status +
                            '" passCode="' +item.passCode + '" serId="' + item.serId + '"name="' + item.name +
                            '" location="front" type="0B">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0B_CLOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
                        }
                        html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
                        html += '</div></li>'
                    } else if (item.type == '0C') { //混流风机
                        html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
                        if(targetStatus == 'W_CLOSE'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_w_CLOSE.png"></div>'
                        }else if(targetStatus == 'F_OPEN_F'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN_F.gif"></div>'
                        }else if(targetStatus == 'F_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN.gif"></div>'
                        }else if(targetStatus == 'W_OPEN'){
                            html += '<div class="pic"><img src="images/device-status/STATUS_0C_W_OPEN.png"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    } else if (item.type == '0D') { //加压风机
                        html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
                            item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
                        if(targetStatus == 'CLOSE'){
                            html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_CLOSE.png"></div>'
                        }else if(targetStatus == 'OPEN'){
                            html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_OPEN.png"></div>'
                        }
                        html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
                        html += '</div></li>'
                    }
                })
                html += '</ul></div>'
            }
 
        } else {
        html +=
            '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d">暂无数据</div></div>';
    }
    } else {
        html +=
            '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d">暂无数据</div></div>';
    }
    $("#recordList").html(html);
 
}
 
//设备操作请求
function toControlDevice() {
    console.log(JSON.stringify(data))
    mui.ajax(url, {
        type: "POST",
        dataType: "json",
        crossDomain: true,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify(data),
        success: function(result) {
            if (result.code == "0000") {
                window.setTimeout(function() {
                    renderDevice();
                }, 200)
            } else {
                mui.alert(result.msg, "提示", ["确定"], function() {}, "div")
            }
        },
        error: function() {
            mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div")
        }
    })
}
 
mui('.mui-scroll-wrapper').scroll({
    indicators: false, //是否显示滚动条
    deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
    bounce: false, //是否启用回弹
    deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
});
//风窗和通风口弹窗
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .chuangkou", function() {
    deviceDetail.passCode = this.getAttribute("passCode");
    deviceDetail.serId = this.getAttribute("serId");
    deviceDetail.location = this.getAttribute("location");
    deviceDetail.type = this.getAttribute("type")
    deviceDetail.status = this.getAttribute("status")
    var name = this.getAttribute("name");
    document.getElementById("Fname").innerText = name
    $('#win_chuangkou').css('display', 'flex');
});
//环流弹窗
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .huanliu", function() {
    deviceDetail.passCode = this.getAttribute("passCode");
    deviceDetail.serId = this.getAttribute("serId");
    deviceDetail.location = this.getAttribute("location");
    deviceDetail.status = this.getAttribute("status")
    deviceDetail.type = '04'
    var name = this.getAttribute("name");
    document.getElementById("huanliuName").innerText = name
    $('#win_huanliu').css('display', 'flex');
});
//混流弹窗
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .hunliu", function() {
    deviceDetail.passCode = this.getAttribute("passCode");
    deviceDetail.serId = this.getAttribute("serId");
    deviceDetail.location = this.getAttribute("location");
    deviceDetail.status = this.getAttribute("status")
    deviceDetail.type = "0C"
    var name = this.getAttribute("name");
    document.getElementById("hunliuName").innerText = name
    $('#win_hunliu').css('display', 'flex');
});
//轴流弹窗
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .zhouliu", function() {
    deviceDetail.passCode = this.getAttribute("passCode");
    deviceDetail.serId = this.getAttribute("serId");
    deviceDetail.location = this.getAttribute("location");
    deviceDetail.status = this.getAttribute("status")
    deviceDetail.type = "02"
    var name = this.getAttribute("name");
    document.getElementById("zhouliuName").innerText = name
    $('#win_zhouliu').css('display', 'flex');
});
//加压风机弹窗
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .jiaya", function() {
    deviceDetail.passCode = this.getAttribute("passCode");
    deviceDetail.serId = this.getAttribute("serId");
    deviceDetail.location = this.getAttribute("location");
    deviceDetail.status = this.getAttribute("status");
    deviceDetail.type = "0D"
    var name = this.getAttribute("name");
    document.getElementById("zhouliuName").innerText = name
    $('#win_jiaya').css('display', 'flex');
});
//设备操作
mui(".m-pop").on("tap", ".inner a", function() {
    //所进行的操作
    var targetStatus = this.getAttribute("targetStatus");
 
    //如果是轴流风机,先根据风机状态判断风机操作是否可以执行
    if (deviceDetail.type == '02') {
        //风机状态为风机开风窗开,即F_OPEN或者F_OPEN_F时,不能执行关风窗操作
        if ((deviceDetail.status == 'F_OPEN' || deviceDetail.status == 'F_OPEN_F') && targetStatus == 'CLOSE') {
            mui.alert("此风机正在运行,不能执行关闭风窗操作!", "提示", ["确定"], function() {}, "div")
            return;
        }
        //风机状态为风机开风窗开,即F_OPEN或者F_OPEN_F时,不能执行风窗全关操作
        if ((deviceDetail.status == 'F_OPEN' || deviceDetail.status == 'F_OPEN_F') && targetStatus ==
            'W_CLOSE_ALL') {
            mui.alert("此风机正在运行,不能执行风窗全关操作!", "提示", ["确定"], function() {}, "div")
            return;
        }
        //风机状态为风机关风窗关,即W_CLOSE时,不能执行开风机操作
        if (deviceDetail.status == 'W_CLOSE' && (targetStatus == 'F_CLOSE' || targetStatus == 'F_OPEN')) {
            mui.alert("此风机的风窗关闭中,不能执行风机操作!", "提示", ["确定"], function() {}, "div")
            return;
        }
    }
    //如果是混流风机,先判断风机操作是否可以执行
    if (deviceDetail.type == '0C') {
        //风机状态为风机开风口开,即F_OPEN时,不能执行关风口操作
        if ((deviceDetail.status == 'F_OPEN_F' || deviceDetail.status == 'F_OPEN') && targetStatus == 'CLOSE') {
            mui.alert("此风机正在运行,不能执行关闭风口操作!", "提示", ["确定"], function() {}, "div")
            return;
        }
        //风机状态为风机开风窗开,即F_OPEN时,不能执行风窗全关操作
        if ((deviceDetail.status == 'F_OPEN_F' || deviceDetail.status == 'F_OPEN') && targetStatus ==
            'W_CLOSE_ALL') {
            mui.alert("此风机正在运行,不能执行风口全关操作!", "提示", ["确定"], function() {}, "div")
            return;
        }
        //风机状态为风机关风窗关,即W_CLOSE时,不能执行开风窗操作
        if (deviceDetail.status == 'W_CLOSE' && (targetStatus == 'F_CLOSE' || targetStatus == 'F_OPEN' ||
                targetStatus == 'F_OPEN_F')) {
            mui.alert("此风机的风口关闭中,不能执行风机操作!", "提示", ["确定"], function() {}, "div")
            return;
        }
        //风机状态为风机开风窗开,即F_OPEN时,不能执行反转操作
        if (deviceDetail.status == 'F_OPEN' && targetStatus == 'F_OPEN_F') {
            mui.alert("此风机正转状态,不能执行反转操作!", "提示", ["确定"], function() {}, "div")
            return;
        }
        //风机状态为风机开风窗开,即F_OPEN_F时,不能执行正转操作
        if (deviceDetail.status == 'F_OPEN_F' && targetStatus == 'F_OPEN') {
            mui.alert("此风机反转状态,不能执行正转操作!", "提示", ["确定"], function() {}, "div")
            return;
        }
    }
    //判断是否是批量
    var batchTag = false;
    if (targetStatus == 'W_OPEN_ALL') {
        targetStatus = 'OPEN';
        batchTag = true;
    }
    if (targetStatus == 'W_CLOSE_ALL') {
        targetStatus = 'CLOSE';
        batchTag = true;
    }
    if (targetStatus == 'OPEN_ALL') {
        targetStatus = 'OPEN';
        batchTag = true;
    }
    if (targetStatus == 'CLOSE_ALL') {
        targetStatus = 'CLOSE';
        batchTag = true;
    }
console.log(batchTag);
 
    // //仓库前面
    data.data.deptId=deptId;
    data.data.depotId=depotId;
    data.data.passCode=deviceDetail.passCode;
    data.data.serId=deviceDetail.serId;
    data.data.targetStatus=targetStatus;
    data.data.type=deviceDetail.type;
    data.data.batchTag=batchTag;
    console.log(JSON.stringify(data.data))
    //发送操作请求
    toControlDevice();
 
    closePop();
});
//关闭弹窗
function closePop() {
    $(".m-pop").css('display', 'none');
}
$('.pop-bg,.m-pop .close').click(function(e) {
    e.stopPropagation();
    $('.m-pop').fadeOut();
});
 
var slider = mui(".mui-slider");
slider.slider({
    interval: 3000
});