fei.wang
2025-03-07 4dde9feedab7c3979f7b5addbdc75d30b6e2c026
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
<!-- 绘制围栏表单组件 -->
<template>
    <view :class="{'m-form':!isStart,'m-form-1':isStart}">
        <view class="m-form-head" v-show="!isStart"><u-icon name="close-circle" color="#fff" size="40"
                @click="cancel"></u-icon></view>
        <view class="m-form-label" v-show="!isStart">
            <u--form labelPosition="left" :model="model" :rules="rules" ref="form" labelWidth="100"
                :labelStyle="{ color: 'rgb(129, 129, 129)' }">
                <u-form-item v-if="Step == 'first'" label="选择标签" prop="type" borderBottom ref="item">
                    <uni-data-select v-model="value_name" :localdata="range" @change="changeRange"></uni-data-select>
                </u-form-item>
                <u-form-item v-if="Step == 'first'" label="标签ID" prop="p_tagid" borderBottom ref="item">
                    <u--input :customStyle="{
                            'background-color': 'rgb(233, 233, 233)',
                            'box-shadow': 'inset 2px 1.464px 5px 0px #ccccc4, 1.464px 1.464px 5px 0px rgba(255, 255, 255, 0.75)'
                        }" readonly placeholderStyle="color:#6a6a6a" color="#000" v-model="model.p_tagid" border="none"></u--input>
                </u-form-item>
 
                <u-form-item v-if="Step == 'first'" label="围栏名称" prop="name" borderBottom ref="item">
                    <u--input :customStyle="{
                            'background-color': 'rgb(233, 233, 233)',
                            'box-shadow': 'inset 2px 1.464px 5px 0px #ccccc4, 1.464px 1.464px 5px 0px rgba(255, 255, 255, 0.75)'
                        }" placeholderStyle="color:#6a6a6a" color="#000" v-model="model.name" border="none"></u--input>
                </u-form-item>
                <u-form-item v-if="Step == 'first'" label="围栏类型" prop="fencetype" borderBottom ref="type">
                    <uni-data-select v-model="model.fencetype" :localdata="rangetype"
                        @change="changeRangeLevel"></uni-data-select>
                </u-form-item>
                <u-form-item v-if="Step == 'first'" label="关联部门" prop="bumen" borderBottom ref="item">
                    <uni-data-select v-model="value_bumen" :localdata="rangeBuMen"
                        @change="changeRangeBuMen"></uni-data-select>
                </u-form-item>
 
                <u-form-item v-if="Step == 'first'" label="带电高度" prop="chargedHeight" borderBottom ref="item">
                    <u--input :customStyle="{
                            'background-color': 'rgb(233, 233, 233)',
                            'box-shadow': 'inset 2px 1.464px 5px 0px #ccccc4, 1.464px 1.464px 5px 0px rgba(255, 255, 255, 0.75)'
                        }" @change="jisuangj" placeholderStyle="color:#6a6a6a" color="#000" v-model="model.chargedHeight"
                        border="none"></u--input>
                </u-form-item>
                <u-form-item v-if="Step == 'first'" label="电压等级" prop="voltageLevel" borderBottom ref="voitem">
                    <uni-data-select v-model="model.voltageLevel" :localdata="rangeLevel"
                        @change="changeRangeLevel"></uni-data-select>
                </u-form-item>
                <u-form-item v-if="Step == 'first'" label="告警高度" prop="baoliu1" borderBottom ref="item">
                    <u--input :customStyle="{
                            'background-color': 'rgb(233, 233, 233)',
                            'box-shadow': 'inset 2px 1.464px 5px 0px #ccccc4, 1.464px 1.464px 5px 0px rgba(255, 255, 255, 0.75)'
                        }" placeholderStyle="color:#6a6a6a" placeholder="单位米" color="#000" v-model="model.baoliu1"
                        border="none"></u--input>
                </u-form-item>
                <u-form-item v-if="Step == 'first'" label="启用围栏" prop="valueSwitch" borderBottom ref="item">
                    <u-switch v-model="model.valueSwitch" asyncChange @change="asyncChange"></u-switch>
                </u-form-item>
 
 
                <u-form-item v-if="Step == 'crane'" label="围栏名称" prop="name" borderBottom ref="item">
                    <u--input :customStyle="{
                            'background-color': 'rgb(233, 233, 233)',
                            'box-shadow': 'inset 2px 1.464px 5px 0px #ccccc4, 1.464px 1.464px 5px 0px rgba(255, 255, 255, 0.75)'
                        }" placeholderStyle="color:#6a6a6a" color="#000" v-model="model.name" border="none"></u--input>
                </u-form-item>
                <u-form-item v-if="Step == 'crane'" label="关联部门" prop="bumen" borderBottom ref="item">
                    <uni-data-select v-model="value_bumen" :localdata="rangeBuMen"
                        @change="changeRangeBuMen"></uni-data-select>
                </u-form-item>
                <u-form-item v-if="Step == 'crane'" label="带电高度" prop="chargedHeight" borderBottom ref="item">
                    <u--input :customStyle="{
                            'background-color': 'rgb(233, 233, 233)',
                            'box-shadow': 'inset 2px 1.464px 5px 0px #ccccc4, 1.464px 1.464px 5px 0px rgba(255, 255, 255, 0.75)'
                        }" @change="jisuangj" placeholderStyle="color:#6a6a6a" color="#000" v-model="model.chargedHeight"
                        border="none"></u--input>
                </u-form-item>
                <u-form-item v-if="Step == 'crane'" label="电压等级" prop="voltageLevel" borderBottom ref="voitem">
                    <uni-data-select v-model="model.voltageLevel" :localdata="rangeLevel"
                        @change="changeRangeLevel"></uni-data-select>
                </u-form-item>
                <u-form-item v-if="Step == 'crane'" label="告警高度" prop="baoliu1" borderBottom ref="item">
                    <u--input :customStyle="{
                            'background-color': 'rgb(233, 233, 233)',
                            'box-shadow': 'inset 2px 1.464px 5px 0px #ccccc4, 1.464px 1.464px 5px 0px rgba(255, 255, 255, 0.75)'
                        }" placeholderStyle="color:#6a6a6a" placeholder="单位米" color="#000" v-model="model.baoliu1"
                        border="none"></u--input>
                </u-form-item>
                <!--     <u-form-item v-if="Step == 'crane'" label="提醒标签" prop="p_warn" borderBottom ref="item">
                    <view v-if="Step == 'crane'" class="uni-px-5 uni-pb-5" style="width: 100%">
                        <mySelectCheckbox v-model="value1" multiple dataKey="text" dataValue="value" :localdata="range"
                            clear style="margin-right: -10px;" @change="change"></mySelectCheckbox>
                    </view>
                </u-form-item> -->
                </u-form-item>
                <u-form-item v-if="Step == 'crane'" label="启用吊高" prop="valueSwitch" borderBottom ref="item">
                    <u-switch v-model="model.valueSwitch" asyncChange @change="asyncChange"></u-switch>
                </u-form-item>
            </u--form>
        </view>
        <view class="m-form-button-list" v-show="!isStart">
            <u-button :disabled="isDisabled" type="primary" text="开始绘制" @click="startDraw"
                v-if="Step == 'first' && isShow"></u-button>
            <u-button type="primary" text="吊车模式" @click="save" v-if="Step == 'first'"></u-button>
            <!-- <u-button type="primary" text="结束绘制" @click="endDraw" v-if="Step == 'first'"></u-button> -->
            <u-button type="primary" text="下一步" @click="nextStep" v-if="Step == 'first' && !isShow"></u-button>
            <u-button type="primary" text="保存围栏" @click="save" v-if="Step == 'second' || Step == 'crane'"></u-button>
        </view>
        <view class="m-form-btn" @click="endDraw" v-if="Step == 'first' && isStart">
            结束绘制
        </view>
    </view>
</template>
 
<script>
    import mySelectCheckbox from './my-selelctCheckbox.vue'
    import {
        connChart,
        getPointsCenter
    } from '@/common/utils.js';
    import {
        formatDate
    } from '@/common/tools.js'
    import {
        gps2xybiandianzhan
    } from '@/common/GnssToXY.js'
    export default {
        props: {
            deviceId: String,
        },
        components: {
            mySelectCheckbox
        },
        data() {
            return {
                isDisabled: true,
                labelModel: '',
                // tally: [],
                value1: '',
                model: {
                    selecttanum: '选择标签',
                    name: '',
                    chargedHeight: '',
                    voltageLevel: '',
                    fencetype: '',
                    valueSwitch: false,
                    baoliu1: '',
                    bumen: '',
                    p_tagid: ''
                },
                rules: {
                    baoliu1: {
                        validator: (rule, value, callback) => {
                            // 返回true表示校验通过,返回false表示不通过
                            var pattern = /^\d+(\.\d{1,2})?$/;
                            return pattern.test(value);
                        },
                        required: true,
                        message: '精度0.01m',
                        trigger: ['blur', 'change']
                    }
                },
                Step: 'first',
                valueList: [],
                range: [],
                value_name: '',
                value_bumen: '',
                rangeBuMen: [],
                rangeLevel: [{
                    value: '0.7m',
                    text: '10kV(0.7m)'
                }, {
                    value: '1m',
                    text: '20~35kV(1m)'
                }, {
                    value: '1.5m',
                    text: '66~110kV(1.5m)'
                }, {
                    value: '3m',
                    text: '220kV(3m)'
                }, {
                    value: '4m',
                    text: '330kV(4m)'
                }, {
                    value: '5m',
                    text: '500kV(5m)'
                }, {
                    value: '6m',
                    text: '750kV(6m)'
                }, {
                    value: '7m',
                    text: '1000kV(7m)'
                }],
                rangetype: [{
                    value: '区域围栏',
                    text: '区域围栏'
                }, {
                    value: '吊高围栏',
                    text: '吊高围栏'
                }],
 
                // rangeLevel:[
                //     '10kV:0.7m',
                //     '20~35kV:1m',
                //     '66~110kV:1.5m',
                //     '220kV:3m',
                //     '330kV:4m',
                //     '500kV:5m',
                //     '750kV:6m',
                //     '1000kV:7m',
                // ],
                isShow: true,
                isStart: false
            };
        },
        methods: {
            //开始绘制
            startDraw() {
                if (this.model.name == '') {
 
                    uni.$u.toast('围栏名称不能为空')
                    // this.isStart=true
                    // return false
                } else if (this.model.fencetype == '') {
 
                    uni.$u.toast('围栏类型不能为空')
                    // this.isStart=true
                    // return false
                } else if (this.model.baoliu1 == '') {
 
                    uni.$u.toast('告警高度不能为空')
                    // this.isStart=true
                    // return false
                } else {
                    var sys = this.$store.state.sys;
                    if (sys.local==false) {
                        var method ='GET'
                        var data = {}  
                        data.serialNumber = this.deviceId
                        data.name = this.model.name
                        console.log(data);
                        var contentType='application/x-www-form-urlencoded'
                        uni.request({
                            // url: "http://192.168.31.101:8181/Fence/", //接口地址。
                            // url: "http://111.198.60.6:6008/Fence/", //接口地址。
                            url: "http://"+sys.baoliu20host+":8181/Fence/", //接口地址。
                            data: data,
                            method: method,
                            header: { //请求头可自定义
                                'content-type': contentType,
                            },
                            timeout:5000,//设置超时时间,默认5秒
                            success: (rep) => { //具体捕获请看自己接口返回的形式
                            console.log(87654345678);
                                console.log(rep)
                                
                                    
                                        // this.railList = [];
                                    //     if (rep.statusCode==200) {
                                    //         rep.data.forEach((e, i) => {
                                    //             e.name=e.name.split(this.deviceId)[0]
                                    //             e.addtime=e.baoliu12
                                    //             this.status = 'loadmore'
                                    //             })
                                    // this.valueList.push(...rep.data)
                                    //     }else{
                                    //         // this.status = 'nomore'
                                    //     }
                                        // console.log(e);
                                        // console.log(r);
                                        if (rep.statusCode==200) {
                                            uni.$u.toast('围栏名称重复')
                                            // this.Step = 'first';
                                            // this.isStart=true 
                                            // this.$emit('submitDrawForm');
                                        } else {
                                            var baoliu77 = this.model.valueSwitch ? '1' : '0'
                                            // this.model.p_tagid
                                            uni.$u.toast('围栏绘制中:手持URT走个闭合围栏然后结束绘制');
                                            this.isStart = true
                                            this.$store.commit('setDefaultData')
                                            var ipa = this.model.name + "," + this.model.fencetype + "," + this.model.bumen + "," +
                                                this.model.baoliu1 + "," + this.model.p_tagid + "," + this.model.chargedHeight +
                                                "," + this.model.voltageLevel + "," + baoliu77
                                            console.log(ipa);
                                            this.$emit('startDraw', {
                                                ipa: ipa,
                                                tag: this.model.p_tagid
                                            });
                                        }
                            },
                            // fail(error) {
                            //     console.log(error);
                            //     uni.hideLoading();
                            //     uni.$u.toast('网络不通');
                            //     // reject(error)
                            // },
                            complete() { 
                                uni.hideLoading();
                            }
                        });
                    }else{
                        var fence = connChart('fence');
                        fence.find(`name='${this.model.name}'`, (e, r) => {
                            console.log(e);
                            console.log(r);
                            if (r.length > 0) {
                                uni.$u.toast('围栏名称重复')
                                // this.Step = 'first';
                                // this.isStart=true 
                                // this.$emit('submitDrawForm');
                            } else {
                                var baoliu77 = this.model.valueSwitch ? '1' : '0'
                                // this.model.p_tagid
                                uni.$u.toast('围栏绘制中:手持URT走个闭合围栏然后结束绘制');
                                this.isStart = true
                                this.$store.commit('setDefaultData')
                                var ipa = this.model.name + "," + this.model.fencetype + "," + this.model.bumen + "," +
                                    this.model.baoliu1 + "," + this.model.p_tagid + "," + this.model.chargedHeight +
                                    "," + this.model.voltageLevel + "," + baoliu77
                                console.log(ipa);
                                this.$emit('startDraw', {
                                    ipa: ipa,
                                    tag: this.model.p_tagid
                                });
                            }
                        
                        })
                    }
                
 
                }
                // this.$emit('startDraw',{tagid:this.model.p_tagid})
            },
            craneDraw() {
                this.Step = 'crane';
                // this.model.p_tagid
                // uni.$u.toast('围栏绘制中:手持URT走个闭合围栏然后结束绘制');
                // this.isStart=true
                // this.$store.commit('setDefaultData')
                // this.$emit('startDraw',{tagid:this.model.p_tagid})
            },
 
 
 
 
 
            //结束绘制
            endDraw() {
                this.isShow = false
                // this.isStart=false
                this.Step = '';
                this.$emit('endDraw',{tagid:this.model.p_tagid})
                // this.$emit('endDraw')
                uni.$u.toast('保存成功')
            },
            //下一步
            nextStep() {
                this.Step = 'second';
            },
            //保存围栏
            save() {
                    var sys = this.$store.state.sys;
                    if (sys.local==false) {
                        var method ='GET'
                        var data = {}  
                        data.serialNumber = this.deviceId
                        data.name = this.model.name
                        console.log(data);
                        var contentType='application/x-www-form-urlencoded'
                        uni.request({
                            // url: "http://192.168.31.101:8181/Fence/", //接口地址。
                            // url: "http://111.198.60.6:6008/Fence/", //接口地址。
                            url: "http://"+sys.baoliu20host+":8181/Fence/", //接口地址。
                            data: data,
                            method: method,
                            header: { //请求头可自定义
                                'content-type': contentType,
                            },
                            timeout:5000,//设置超时时间,默认5秒
                            success: (rep) => { //具体捕获请看自己接口返回的形式
                            console.log(87654345678);
                                console.log(rep)
                                        if (rep.statusCode==200) {
                                            uni.$u.toast('围栏名称重复')
                                            // this.Step = 'first';
                                            // this.isStart=true 
                                            // this.$emit('submitDrawForm');
                                        } else {
                                                var baoliu77 = this.model.valueSwitch ? '1' : '0'
                                                // var fencetype2 = this.Step == 'second' ? '区域围栏' : '吊高围栏'
                                                // if (!e) {
                                            
                                                    // for (var i = 0; i < this.value1.length; i++) {
                                                    //     this.value1[i]
                                                    //     this.labelModel = connChart('label')
                                                    //     this.labelModel.update(`id='${this.value1[i]}'`, {
                                                    //         baoliu12: this.model.name,
                                                    //         // p_warn: list,
                                                    //         // p_tagid: this.model.p_tagid,
                                                    //         // baoliu12: this.model.baoliu12
                                                    //     }, (err, results) => {
                                                    //         // this.$emit('submitTallyForm');
                                                    //     });
                                                    // }
                                                    uni.$u.toast('保存成功')
                                                    // console.log(this.model.bumen);
                                                    // console.log(list);
                                                    // var ipa = this.model.name+"," +this.model.bumen+","+this.model.baoliu1+","+this.model.chargedHeight+","+this.model.p_tagid
                                            
                                                    var ipa = this.model.name + "," + this.model.fencetype + "," + this.model
                                                        .bumen + "," + this.model.baoliu1 + "," + this.model.p_tagid + "," +
                                                        this.model.chargedHeight + "," + this.model.voltageLevel + "," +
                                                        baoliu77
                                                    console.log(ipa);
                                                    this.$emit('submitDrawForm', {
                                                        ipa: ipa
                                                    });
                                                    // this.$emit('submitDrawForm');
                                                // }
                                            
                                            this.isShow = false
                                            this.isStart = false
                                            this.Step = '';
                                            this.$emit('endDraw')
                                        }
                            },
                            // fail(error) {
                            //     console.log(error);
                            //     uni.hideLoading();
                            //     uni.$u.toast('网络不通');
                            //     // reject(error)
                            // },
                            complete() { 
                                uni.hideLoading();
                            }
                        });
                    }else{
                        
                        
 
                var fence = connChart('fence');
                fence.find(`name='${this.model.name}'`, (e, r) => {
                    console.log(e);
                    console.log(r);
                    if (r.length > 0) {
                        uni.$u.toast('围栏名称重复')
                        // this.Step = 'first';
                        // this.isStart=true
                        // this.$emit('submitDrawForm');
                    } else {
                        var center = getPointsCenter(this.$store.state.tallyRailPositon_j_w_list)
                        // console.log(center.split(',')[0],center.split(',')[1])
                        var max_x = Math.max.apply(Math, this.$store.state.tallyRailPositon_j_w.map(item => {
                            return item.x
                        }))
                        var max_y = Math.max.apply(Math, this.$store.state.tallyRailPositon_j_w.map(item => {
                            return item.y
                        }))
                        var min_x = Math.min.apply(Math, this.$store.state.tallyRailPositon_j_w.map(item => {
                            return item.x
                        }))
                        var min_y = Math.min.apply(Math, this.$store.state.tallyRailPositon_j_w.map(item => {
                            return item.y
                        }))
                        var max_point = gps2xybiandianzhan(this.$store.state.yuandian_jingdu, this.$store.state
                            .yuandian_weidu, max_x, max_y)
                        var min_point = gps2xybiandianzhan(this.$store.state.yuandian_jingdu, this.$store.state
                            .yuandian_weidu, min_x, min_y)
                        var centerpoint = gps2xybiandianzhan(this.$store.state.yuandian_jingdu, this.$store.state
                            .yuandian_weidu, center[0], center[1])
                        var labelModel = connChart('fence');
                        labelModel.insert({
                            baoliu1: this.model.baoliu1,
                            floor: '0',
                            fencetype: this.Step == 'second' ? '区域围栏' : '吊高围栏',
                            chargedHeight: this.model.chargedHeight,
                            voltageLevel: this.model.voltageLevel,
                            fencetype: this.model.fencetype,
                            name: this.model.name,
                            // chargedHeight:this.model.chargedHeight,
                            bumen: this.model.bumen,
                            baoliu7: this.model.valueSwitch ? '1' : '0',
                            zuobiao: JSON.stringify(this.$store.state.tallyRailPositon),
                            pts: JSON.stringify(this.$store.state.tallyRailPositon_j_w),
                            max: max_point[0] + ',' + max_point[1],
                            min: min_point[0] + ',' + min_point[1],
                            addtime: formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'),
                            centerpoint: centerpoint[0] + ',' + centerpoint[1],
                        }, (e, r) => {
                            var baoliu77 = this.model.valueSwitch ? '1' : '0'
                            var fencetype2 = this.Step == 'second' ? '区域围栏' : '吊高围栏'
                            if (!e) {
 
                                for (var i = 0; i < this.value1.length; i++) {
                                    this.value1[i]
                                    this.labelModel = connChart('label')
                                    this.labelModel.update(`id='${this.value1[i]}'`, {
                                        baoliu12: this.model.name,
                                        // p_warn: list,
                                        // p_tagid: this.model.p_tagid,
                                        // baoliu12: this.model.baoliu12
                                    }, (err, results) => {
                                        // this.$emit('submitTallyForm');
                                    });
                                }
                                uni.$u.toast('保存成功')
                                // console.log(this.model.bumen);
                                // console.log(list);
                                // var ipa = this.model.name+"," +this.model.bumen+","+this.model.baoliu1+","+this.model.chargedHeight+","+this.model.p_tagid
 
                                var ipa = this.model.name + "," + this.model.fencetype + "," + this.model
                                    .bumen + "," + this.model.baoliu1 + "," + this.model.p_tagid + "," +
                                    this.model.chargedHeight + "," + this.model.voltageLevel + "," +
                                    baoliu77
                                console.log(ipa);
                                this.$emit('submitDrawForm', {
                                    ipa: ipa
                                });
                                // this.$emit('submitDrawForm');
                            }
                        })
                        this.isShow = false
                        this.isStart = false
                        this.Step = '';
                        this.$emit('endDraw')
                    }
                })
 
                }
 
 
            },
            //取消
            cancel() {
                this.$emit('cancelDrawForm');
            },
            change(e) {
                console.log('e:', e);
            },
            //启用围栏-开关
            asyncChange(e) {
                this.model.valueSwitch = e;
                // uni.showModal({
                //     content: e ? '确定要打开吗' : '确定要关闭吗',
                //     confirmColor:"#68B0FE",
                //     cancelColor:"#68B0FE",
                //     success: res => {
                //         if (res.confirm) {
                //             this.model.valueSwitch = e;
                //         }
                //     }
                // });
            },
            //获取标签列表数据
            getTallyList() {
                var labelModel = connChart('label');
                labelModel.find((e, r) => {
                    // console.log(e,r)
                    if (r.length != 0) {
                        this.range = [];
                        r.forEach((e, index) => {
                            this.range.push({
                                text: e.p_tagid + ' ' + e.p_name,
                                value: e.p_tagid
                            });
                        });
                    }
                })
            },
            //部门查询
            jiedepartment() {
                var labelModel = connChart('department');
                labelModel.find((e, r) => {
                    if (r.length != 0) {
                        r.forEach(e => {
                            this.rangeBuMen.push({
                                text: e.department_name,
                                value: e.department_name
                            });
                            if (e.department_name == '系统默认') {
                                this.value_bumen = e.department_name;
                                this.model.bumen = e.department_name;
                            }
                        });
 
                    }
                })
            },
            changeRange(e) {
                this.value_name = e;
                this.model.p_tagid = e;
                if (this.model.p_tagid != '') {
                    this.isDisabled = false;
                }
 
            },
            changeRangeBuMen(e) {
                this.value_bumen = e;
                this.model.bumen = e;
            },
            changeRangeLevel(e) {
                if (this.model.chargedHeight != '') {
                    this.model.baoliu1 = (this.model.chargedHeight - e.split("m")[0]).toFixed(2)
                }
                this.voltageLevel = e;
                this.model.voltageLevel = e;
            },
            changeRangetype(e) {
                this.fencetype = e;
                this.model.fencetype = e;
            },
 
            jisuangj(e) {
                if (this.model.voltageLevel != '') {
 
                    this.model.baoliu1 = (e - this.model.voltageLevel.split("m")[0]).toFixed(2)
                }
                // this.value_bumen = e;
                // this.model.bumen = e;
            },
 
        },
        mounted() {
            console.log(this.Step);
            this.getTallyList();
            this.jiedepartment();
        }
    };
</script>
 
<style lang="scss" scoped>
    .m-form {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: rgba(233, 233, 233, 0.8);
        width: 60%;
        display: flex;
        flex-direction: column;
        z-index: 700;
        box-shadow: -3.536px -3.536px 5px 0px rgba(255, 255, 255, 0.75), 4.721px 6.457px 8px -5px rgba(191, 191, 191, 1);
    }
 
    .m-form-1 {
        position: fixed;
        bottom: 8em;
        left: 50%;
        transform: translate(-50%, 0);
        z-index: 700;
 
        .m-form-btn {
            background-color: rgba(69, 158, 255, 0.9);
            border-radius: 3em;
            width: 10em;
            padding: 15px 0;
            color: #fff;
            font-size: 1.5em;
            text-align: center;
        }
    }
 
    .m-form-head {
        width: 100%;
        border-bottom: 1px solid #fff;
    }
 
    .m-form-head .u-icon {
        float: right;
    }
 
    /deep/ .u-form-item__body__left__content__label {
        color: #fff;
    }
 
    .m-form-label {
        width: 80%;
        margin: 0 auto;
        margin-bottom: 0.5em;
    }
 
    .m-form-button-list {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1em;
    }
 
    .m-form-button-list .u-button {
        width: 5em;
    }
 
    // .m-form-button-list .u-button:nth-child(2),
    // .m-form-button-list .u-button:nth-child(3),
    // .m-form-button-list .u-button:nth-child(4) {
    //     margin-top: 1em;
    // }
</style>