陈战涛
2023-03-14 c29ed2aa867b00eccfdc7c3a68f431008b13ea7d
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
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>风机控制</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link href="./css/mui.min.css" rel="stylesheet" />
 
        <style>
            .mui-bar-nav {
                background: #245ca7;
                -webkit-box-shadow: none;
                box-shadow: none;
            }
 
            .mui-title {
                color: #FFFFFF;
            }
 
            .mui-icon-back:before,
            .mui-icon-left-nav:before {
                color: #FFFFFF;
            }
 
            .mui-grid-view.mui-grid-9 .mui-media .mui-icon {
                font-size: 2.4em;
                position: relative;
                border-radius: 50px;
                padding: 12px;
            }
 
            .mui-grid-view.mui-grid-9 .mui-media {
                background: #c6c8ca;
                height: 130px;
                width: 33.3333%;
            }
 
            .mui-grid-view.mui-grid-9 {
                padding: 5px 5px;
                border-top: none;
                border-left: none;
            }
 
            .mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body {
                color: #0062cc;
                margin-top: unset;
            }
 
            .img_ico {
                width: 70px;
                height: auto;
                display: block;
                margin: auto;
                margin-top: 10px;
            }
 
            .title {
                background-color: #FFFFFF;
                display: block;
                padding: 0 15px;
                box-sizing: border-box;
                color: #333;
                height: 40px;
                line-height: 40px;
            }
 
            /*操作弹出窗*/
            .mark_one {
                background: rgba(0, 0, 0, .8);
                position: fixed;
                left: 0px;
                top: 0px;
                right: 0px;
                bottom: 0px;
                z-index: 10000;
                display: flex;
            }
 
            .mark_one_layer {
                background: #fff;
                width: 85%;
                margin: auto;
                border-radius: 5px;
            }
 
            .mark_one_layer .title {
                background: #245ca7;
                line-height: 40px;
                padding: 0 15px;
                box-sizing: border-box;
                color: #fff;
                border-radius: 5px 5px 0 0;
            }
 
            .mark_one_layer .title a {
                line-height: 40px;
                font-size: 2.5rem;
                float: right;
            }
 
            .mark_one_layer .btn {
                display: block;
                font-size: 1.5rem;
                text-align: center;
            }
 
            .mark_one_layer .btn button {
                color: #fff;
                border-radius: 5px;
                line-height: 35px;
                font-size: 16px;
                margin: 10px 10px;
            }
 
            .mark_one_btn1 {
                background: #2f64ab;
                width: 40%;
            }
 
            .mark_one_btn2 {
                background: #e4606d;
                width: 40%;
            }
 
            .mark_one_btn3 {
                background: #117a8b;
                width: 40%;
            }
 
            .mark_one_btn4 {
                background: #e4606d;
                width: 25%;
            }
 
            .mark_one_btn5 {
                background: #117a8b;
                width: 25%;
            }
 
            a {
                text-decoration: none;
                color: #f7f7f7;
            }
        </style>
    </head>
    <body>
        <header class="mui-bar mui-bar-nav">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
            <h1 class="mui-title"><span id="depotName"></span>风机设备</h1>
        </header>
        <div class="mui-content">
            <div id="deviceList1">
                <!-- <div class="title"><strong>仓库正面</strong></div>
                <ul class="mui-table-view mui-grid-view mui-grid-9">
                    <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                        <a href="javascript:void(0)" onclick="openDialog('','one')">
                            <div class="mui-media-body">##1</div>
                            <img class="img_ico" src="./images/device-status/">
                        </a>
                    </li>
                    <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                        <a href="javascript:void(0)" onclick="openDialog('','one')">
                            <div class="mui-media-body">##2</div>
                            <img class="img_ico" src="./images/device-status/STATUS_01_CLOSE.png">
                        </a>
                    </li>
                    <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                        <a href="javascript:void(0)" onclick="openDialog('','one')">
                            <div class="mui-media-body">##3</div>
                            <img class="img_ico" src="./images/device-status/STATUS_01_CLOSE.png">
                        </a>
                    </li>
                </ul> -->
            </div>
            <div id="deviceList2">
                <!-- <div class="title"><strong>仓库背面</strong></div>
                <ul class="mui-table-view mui-grid-view mui-grid-9">
                    <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                        <a href="javascript:void(0)" onclick="openDialog('','two')">
                            <div class="mui-media-body">##1</div>
                            <img class="img_ico" src="./images/device-status/STATUS_02_F_OPEN_F.gif">
 
                        </a>
                    </li>
                    <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                        <a href="javascript:void(0)" onclick="openDialog('','two')">
                            <div class="mui-media-body">##3</div>
                            <img class="img_ico" src="./images/device-status/STATUS_02_F_OPEN.gif">
                        </a>
                    </li>
                    <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                        <a href="javascript:void(0)" onclick="openDialog('','two')">
                            <div class="mui-media-body">##2</div>
                            <img class="img_ico" src="./images/device-status/STATUS_02_W_OPEN.png">
                        </a>
                    </li>
                    <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
                        <a href="javascript:void(0)" onclick="openDialog('','two')">
                            <div class="mui-media-body">##2</div>
                            <img class="img_ico" src="./images/device-status/STATUS_02_W_CLOSE.png">
                        </a>
                    </li>
                </ul> -->
            </div>
 
            <!--轴流风机弹窗-->
            <div class="mark_one" id="openOne" style="display: none;">
                <div class="mark_one_layer">
                    <div class="title">
                        <span style="font-size: 16px;" id="markName1">设备操作</span>
                        <a onclick="closeDialog()" class="close">&times;</a>
                    </div>
                    <div class="btn">
                        <button class="mark_one_btn1 mb-3" onclick="toExecute('OPEN')">
                            开风窗
                        </button>
                        <button class="mark_one_btn2 mb-3" onclick="toExecute('CLOSE')">
                            关风窗
                        </button>
                    </div>
                    <div class="btn">
                        <button class="mark_one_btn3 mb-3" onclick="toExecute('F_OPEN')">
                            开风机
                        </button>
                        <button class="mark_one_btn2 mb-3" onclick="toExecute('F_CLOSE')">
                            关风机
                        </button>
                    </div>
                    <div class="btn">
                        <button class="mark_one_btn1 mb-3" onclick="toExecute('W_OPEN_ALL')">
                            风窗全开
                        </button>
                        <button class="mark_one_btn2 mb-3" onclick="toExecute('W_CLOSE_ALL')">
                            风窗全关
                        </button>
                    </div>
                </div>
            </div>
            <!--环流风机弹窗-->
            <div class="mark_one" id="openTwo" style="display: none;">
                <div class="mark_one_layer">
                    <div class="title">
                        <span style="font-size: 16px;" id="markName2">设备操作</span>
                        <a onclick="closeDialog()" class="close">&times;</a>
                    </div>
                    <div class="btn">
                        <button class="mark_one_btn5 mb-3" onclick="toExecute('F_OPEN')">
                            强风
                        </button>
                        <button class="mark_one_btn4 mb-3" onclick="toExecute('F_CLOSE')">
                            关风机
                        </button>
                        <button class="mark_one_btn5 mb-3" onclick="toExecute('F_OPEN_F')">
                            弱风
                        </button>
                    </div>
                </div>
            </div>
            <!--混流风机弹窗-->
            <div class="mark_one" id="openThree" style="display: none;">
                <div class="mark_one_layer">
                    <div class="title">
                        <span style="font-size: 16px;" id="markName3">设备操作</span>
                        <a onclick="closeDialog()" class="close">&times;</a>
                    </div>
                    <div class="btn">
                        <button class="mark_one_btn1 mb-3" onclick="toExecute('OPEN')">
                            开风口
                        </button>
                        <button class="mark_one_btn2 mb-3" onclick="toExecute('CLOSE')">
                            关风口
                        </button>
                    </div>
                    <div class="btn">
                        <button class="mark_one_btn5 mb-3" onclick="toExecute('F_OPEN')">
                            正转
                        </button>
                        <button class="mark_one_btn4 mb-3" onclick="toExecute('F_CLOSE')">
                            关风机
                        </button>
                        <button class="mark_one_btn5 mb-3" onclick="toExecute('F_OPEN_F')">
                            反转
                        </button>
                    </div>
                    <div class="btn">
                        <button class="mark_one_btn1 mb-3" onclick="toExecute('W_OPEN_ALL')">
                            风口全开
                        </button>
                        <button class="mark_one_btn2 mb-3" onclick="toExecute('W_CLOSE_ALL')">
                            风口全关
                        </button>
                    </div>
                </div>
            </div>
            <!--加压风机弹窗-->
            <div class="mark_one" id="openFour" style="display: none;">
                <div class="mark_one_layer">
                    <div class="title">
                        <span style="font-size: 16px;" id="markName4">设备操作</span>
                        <a onclick="closeDialog()" class="close">&times;</a>
                    </div>
 
                    <div class="btn">
                        <button class="mark_one_btn3 mb-3" onclick="toExecute('OPEN')">
                            打开
                        </button>
                        <button class="mark_one_btn2 mb-3" onclick="toExecute('CLOSE')">
                            关闭
                        </button>
                    </div>
                    <div class="btn">
                        <button class="mark_one_btn3 mb-3" onclick="toExecute('OPEN_ALL')">
                            全开
                        </button>
                        <button class="mark_one_btn2 mb-3" onclick="toExecute('OPEN_ALL')">
                            全关
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <script src="./js/mui.js"></script>
        <script src="./js/jquery.min.js"></script>
        <script src="./js/echarts.min.js"></script>
 
        <script type="text/javascript" charset="utf-8">
            var url; //接口路径
            var deviceList; //设备集合
            var indexTag = null; //设备操作时的标记
            //获取仓库下的通风设备请求参数
            var data1 = {
                "interfaceId": "5402",
                "sign": "10402",
                "outId": "10402",
                "reqDateTime": new Date(),
                "tokenAuth": "",
                "data": {
                    "depotId": "",
                    "type": "02", //轴流风机
                    "type1": "04", //环流风机
                    "type2": "0C", //混流风机
                    "type3": "0D" //加压风机
                }
            };
            //控制设备参数
            var data2 = {
                "interfaceId": "5403",
                "sign": "10403",
                "outId": "10403",
                "reqDateTime": new Date(),
                "tokenAuth": "",
                "data1": []
            };
            mui.init()
            mui.plusReady(function() {
                //获取参数
                var curr = plus.webview.currentWebview();
                var user = JSON.parse(localStorage.getItem('user'));
                $("#depotName").html(curr.depotName);
                //参数赋值
                data1.tokenAuth = user.tokenAuth;
                data1.data.depotId = curr.depotId;
                data2.tokenAuth = user.tokenAuth;
                url = user.url + "/api-phone/gateway";
                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") {
                            deviceList = result.data;
                            if (deviceList != null && deviceList.length > 0) {
                                renderDeviceList();
                            } else {
                                mui.alert('暂无设备!', '提示',["确定"],function(){},"div");
                            }
                        } else {
                            mui.alert('无相关设备信息!', '提示',["确定"],function(){},"div");
                        }
                    },
                    error: function() {
                        mui.alert('系统繁忙,请重试!', '提示',["确定"],function(){},"div");
                    }
                })
            }
 
            //渲染
            function renderDeviceList() {
                //标记仓库正反面的设备数
                var count1 = 0;
                var count2 = 0;
 
                var html1 = '';
                var html2 = '';
                html1 += '<div class="title"><strong>仓库正面</strong></div><ul class="mui-table-view mui-grid-view mui-grid-9">';
                html2 += '<div class="title"><strong>仓库背面</strong></div><ul class="mui-table-view mui-grid-view mui-grid-9">';
                var img_url;
                var typeTag;
                $.each(deviceList, function(index, item) {
                    img_url = '';
                    typeTag = '';
                    //设置设备图片路径
                    if (item.type == "02") {
                        typeTag = 'one';
                        if (item.status == "F_OPEN_F") {
                            img_url = './images/device-status/STATUS_02_F_OPEN_F.gif';
                        } else if (item.status == "F_OPEN") {
                            img_url = './images/device-status/STATUS_02_F_OPEN.gif';
                        } else if (item.status == "F_CLOSE") {
                            img_url = './images/device-status/STATUS_02_W_OPEN.png';
                        } else if (item.status == "W_OPEN") {
                            img_url = './images/device-status/STATUS_02_W_OPEN.png';
                        } else {
                            img_url = './images/device-status/STATUS_02_W_CLOSE.png';
                        }
                    } else if (item.type == "04") {
                        typeTag = 'two';
                        if (item.status == "OPEN") {
                            img_url = './images/device-status/STATUS_04_OPEN.gif';
                        } else {
                            img_url = './images/device-status/STATUS_0B_CLOSE.png';
                        }
                    } else if (item.type == "0C") {
                        typeTag = 'three';
                        if (item.status == "F_OPEN_F") {
                            img_url = './images/device-status/STATUS_0C_F_OPEN_F.gif';
                        } else if (item.status == "F_OPEN") {
                            img_url = './images/device-status/STATUS_0C_F_OPEN.gif';
                        } else if (item.status == "F_CLOSE") {
                            img_url = './images/device-status/STATUS_0C_W_OPEN.png';
                        } else if (item.status == "W_OPEN") {
                            img_url = './images/device-status/STATUS_0C_W_OPEN.png';
                        } else {
                            img_url = './images/device-status/STATUS_0C_W_CLOSE.png';
                        }
                    } else if (item.type == "0D") {
                        typeTag = 'four';
                        if (item.status == "OPEN") {
                            img_url = './images/device-status/STATUS_0D_OPEN.gif';
                        } else {
                            img_url = './images/device-status/STATUS_0D_CLOSE.png';
                        }
                    }
                    if (item.location == '01') { //仓库正面
                        html1 += '<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="javascript:void(0)" ' +
                            'onclick="openDialog(\'' + index + '\',\'' + typeTag + '\')">';
                        html1 += '<div class="mui-media-body">' + item.name + '</div><img class="img_ico" ';
                        html1 += 'src="' + img_url + '">';
                        html1 += '</a></li>';
                        count1++;
                    } else if (item.location == '02') { //仓库背面
                        html2 += '<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="javascript:void(0)" ' +
                            'onclick="openDialog(\'' + index + '\',\'' + typeTag + '\')">';
                        html2 += '<div class="mui-media-body">' + item.name + '</div><img class="img_ico" ';
                        html2 += 'src="' + img_url + '">';
                        html2 += '</a></li>';
                        count2++;
                    }
                })
                html1 += '</ul>';
                html2 += '</ul>';
                if (count1 > 0) {
                    $("#deviceList1").html(html1);
                } else {
                    $("#deviceList1").html("");
                }
                if (count2 > 0) {
                    $("#deviceList2").html(html2);
                } else {
                    $("#deviceList2").html("");
                }
            }
 
            //设备操作
            function toExecute(targetStatus) {
                
                if (indexTag != null && indexTag >= 0) {
                    //如果是轴流风机,先根据风机状态判断风机操作是否可以执行
                    if (deviceList[indexTag].type == '02') {
                        //风机状态为风机开风窗开,即F_OPEN或者F_OPEN_F时,不能执行关风窗操作
                        if ((deviceList[indexTag].status == 'F_OPEN' || deviceList[indexTag].status == 'F_OPEN_F') && targetStatus == 'CLOSE') {
                            mui.alert("此风机正在运行,不能执行关闭风窗操作!","提示",["确定"],function(){},"div")
                            return;
                        }
                        //风机状态为风机开风窗开,即F_OPEN或者F_OPEN_F时,不能执行风窗全关操作
                        if ((deviceList[indexTag].status == 'F_OPEN' || deviceList[indexTag].status == 'F_OPEN_F') && targetStatus == 'W_CLOSE_ALL') {
                            mui.alert("此风机正在运行,不能执行风窗全关操作!","提示",["确定"],function(){},"div")
                            return;
                        }
                        //风机状态为风机关风窗关,即W_CLOSE时,不能执行开风机操作
                        if (deviceList[indexTag].status == 'W_CLOSE' && (targetStatus == 'F_CLOSE' || targetStatus == 'F_OPEN')) {
                            mui.alert("此风机的风窗关闭中,不能执行风机操作!","提示",["确定"],function(){},"div")
                            return;
                        }
                    }
                    //如果是混流风机,先判断风机操作是否可以执行
                    if (deviceList[indexTag].type == '0C') {
                        //风机状态为风机开风口开,即F_OPEN时,不能执行关风口操作
                        if ((deviceList[indexTag].status == 'F_OPEN_F' || deviceList[indexTag].status == 'F_OPEN') && targetStatus == 'CLOSE') {
                            mui.alert("此风机正在运行,不能执行关闭风口操作!","提示",["确定"],function(){},"div")
                            return;
                        }
                        //风机状态为风机开风窗开,即F_OPEN时,不能执行风窗全关操作
                        if ((deviceList[indexTag].status == 'F_OPEN_F' || deviceList[indexTag].status == 'F_OPEN') && targetStatus == 'W_CLOSE_ALL') {
                            mui.alert("此风机正在运行,不能执行风口全关操作!","提示",["确定"],function(){},"div")
                            return;
                        }
                        //风机状态为风机关风窗关,即W_CLOSE时,不能执行开风窗操作
                        if (deviceList[indexTag].status == 'W_CLOSE' && (targetStatus == 'F_CLOSE' || targetStatus == 'F_OPEN' || targetStatus ==
                                'F_OPEN_F')) {
                            mui.alert("此风机的风口关闭中,不能执行风机操作!","提示",["确定"],function(){},"div")
                            return;
                        }
                        //风机状态为风机开风窗开,即F_OPEN时,不能执行反转操作
                        if (deviceList[indexTag].status == 'F_OPEN' && targetStatus == 'F_OPEN_F') {
                            mui.alert("此风机正转状态,不能执行反转操作!","提示",["确定"],function(){},"div")
                            return;
                        }
                        //风机状态为风机开风窗开,即F_OPEN_F时,不能执行正转操作
                        if (deviceList[indexTag].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;
                    }
 
                    //参数清空
                    data2.data1 = [];
                    if (batchTag) { //批量操作
                        $.each(deviceList, function(index, item) {
                            if (deviceList[indexTag].type == item.type) {
                                data2.data1.push({
                                    "id": item.id,
                                    "depotId": item.depotId,
                                    "passCode": item.passCode,
                                    "name": item.name,
                                    "serId": item.serId,
                                    "link": item.link,
                                    "type": item.type,
                                    "targetStatus": targetStatus
                                })
                            }
                        })
                    } else { //单设备操作
                        data2.data1.push({
                            "id": deviceList[indexTag].id,
                            "depotId": deviceList[indexTag].depotId,
                            "passCode": deviceList[indexTag].passCode,
                            "name": deviceList[indexTag].name,
                            "serId": deviceList[indexTag].serId,
                            "link": deviceList[indexTag].link,
                            "type": deviceList[indexTag].type,
                            "targetStatus": targetStatus
                        })
                    }
                    //发送操作请求
                    toControlDevice();
 
                    //关闭弹窗
                    closeDialog();
                }
            }
 
            //设备操作请求
            function toControlDevice() {
                mui.ajax(url, {
                    type: "POST",
                    dataType: "json",
                    crossDomain: true,
                    contentType: "application/json;charset=utf-8",
                    data: JSON.stringify(data2),
                    success: function(result) {
                        if (result.code == "0000") {
                            mui.alert("操作命令发送成功,请等待30秒后重新打开此页面!","提示",["确定"],function(){},"div")
                        } else {
                            mui.alert(result.msg,"提示",["确定"],function(){},"div")
                        }
                    },
                    error: function() {
                        mui.alert("系统繁忙,请重试!","提示",["确定"],function(){},"div")
                    }
                })
            }
 
            //打开弹窗
            function openDialog(index, tag) {
                indexTag = index;
                if (tag == 'one') {
                    $("#markName1").html("设备操作 - " + deviceList[index].name);
                    $('#openOne').css('display', 'flex');
                }
                if (tag == 'two') {
                    $("#markName2").html("设备操作 - " + deviceList[index].name);
                    $('#openTwo').css('display', 'flex');
                }
                if (tag == 'three') {
                    $("#markName3").html("设备操作 - " + deviceList[index].name);
                    $('#openThree').css('display', 'flex');
                }
                if (tag == 'four') {
                    $("#markName4").html("设备操作 - " + deviceList[index].name);
                    $('#openFour').css('display', 'flex');
                }
            }
 
            //关闭弹窗
            function closeDialog() {
                indexTag = null;
                $("#openOne").css('display', 'none');
                $("#openTwo").css('display', 'none');
                $("#openThree").css('display', 'none');
                $("#openFour").css('display', 'none');
            }
        </script>
    </body>
</html>