fei.wang
6 天以前 645834e1c3efb3a8c50dcbda98d87caba04bd421
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
<template>
    <view class="link-box">
        <view class="link-bottom">
            <view class="userinfo-box">
                <view class="userinfo-img" style="width: 20%;">
 
                    <image src="../static/user.png" style="width:50px;height:50px;"></image>
                </view>
                <view class="userinfo-value-box" style="width: 80%;">
                    <view class="user-nickname">{{perlist.personname}}</view>
                    <view class="user-company">{{perlist.department}} |编号: {{perlist.tagid}}
                        <tn-button v-if="perlist.type=='吊车' || perlist.type=='登高作业人'" size="sm" style="margin-left: 3%;"
                            backgroundColor="#00aaff" @click="calibration(perlist.height)">校准</tn-button>
                    </view>
 
                </view>
                <span v-if="perlist.type=='吊车' || perlist.type=='登高作业人'"
                    style="position: absolute;right:80px;top:10px;height:20px;">
                    高度:{{ jisuan(perlist) }}m
                </span>
                <!-- <view style="position: absolute;right:10px;top:10px;"> -->
                <!-- <button plain @click="refresh" style="width:20px;"> -->
                <image src="../static/refresh.png" class="icon-image" @click="refresh"
                    style="position: absolute;right:40px;top:10px;width:20px;height:20px;"></image>
                <!-- </button> -->
                <image src="../static/close.png" style="position: absolute;right:10px;top:10px;width:20px;height:20px;"
                    @click="closeinfo">
                </image>
                <!-- </view> -->
            </view>
            <view class="content-box">
                <span style="margin-left: 3%;">
                    标签类型:{{ perlist.baoliu1 }}
                </span>
                <span style="width: 47%; float: right;margin-right: 3%;">
                    性质:{{ perlist.type }}
                </span>
                <view style="margin-top: 3%;">
                    <span style="margin-left: 3%;">
                        差分信源:{{perlist.rtcm}}
                    </span>
 
                </view>
                <view style="margin-top: 3%;">
                    <span style="margin-left: 3%;">
                        海拔:{{perlist.height}}m
 
                    </span>
 
                    <span style="width: 47%; float: right;margin-right: 3%;">
                        速度:无
                        <!-- 加密:{{perlist.encryption}} -->
                    </span>
                </view>
                <view style="margin-top: 3%;">
                    <span style="margin-left: 3%;">
                        电量:{{perlist.power}}%
                    </span>
 
                    <span v-if="perlist.encryption!=''" style="width: 20%;margin-left: 5%; ">
 
                        加密:{{perlist.encryption}}
                    </span>
 
                    <span style="width: 37%; float: right;margin-right: 3%;">
                        状态:{{ getGpsStatusText(perlist.gpsstatus) }}
                    </span>
                </view>
            </view>
            <!-- <view class="bu-box">
                
                <button style="width: 80%;left: 5px;" type="primary" @click="copyInfo">复制</button>
            </view> -->
        </view>
 
        <u-modal style="position: absolute;z-index: 99999999999999;" buttonReverse confirmText="保存" cancelText="取消"
            :show="show" @cancel="cancelmodal" @confirm="startdraw" ref="uModal" :showCancelButton="true"
            :closeOnClickOverlay="true">
            <!-- <u-icon name="close" style="position: absolute;right: 10px;top:10px" @click="closemodal"></u-icon> -->
            <view style="max-height: 600px; overflow-y: auto;">
 
                <u--form style="" labelPosition="left" ref="uForm">
                    <u-form-item required label="终端编号:" borderBottom ref="item1" labelWidth="80px"
                        @click="showtagid = true">
                        <!-- <u-badge v-if="tagonlie==1 && code!=''" :isDot="true" type="success"></u-badge>
                        <u-badge v-else-if="tagonlie==0 && code!=''" :isDot="true" type="info"></u-badge> -->
                        <!-- <u--input v-model="code" border="none" placeholder="请输入终端编号" @blur="seachcode"></u--input> -->
                        <!-- <tn-input v-model="code" type="select" @click="showtagid = true" placeholder="请选择终端编号" /> -->
                        <u-input v-model="code" disabled disabledColor="#ffffff" placeholder="请选择终端编号" border="none" />
                        <!-- <tn-action-sheet :list="bumenList" v-model="show1" @click="bymenCallback"></tn-action-sheet> -->
                        <u-icon slot="right" name="arrow-down"></u-icon>
                        <tn-select v-model="showtagid" mode="single" :list="tagidlist" @confirm="confirmtagid"
                            :searchShow="true"></tn-select>
                    </u-form-item>
                    <u-form-item required label="选择围栏:" borderBottom ref="item1" labelWidth="80px"
                        @click="showfname = true">
                        <!--     <tn-input v-model="fencename" type="select" @click="showfname = true" placeholder="请选择围栏" /> -->
 
                        <u-input v-model="fencename" disabled disabledColor="#ffffff" placeholder="请选择围栏"
                            border="none" />
                        <!-- <tn-action-sheet :list="bumenList" v-model="show1" @click="bymenCallback"></tn-action-sheet> -->
                        <u-icon slot="right" name="arrow-down"></u-icon>
                        <tn-select v-model="showfname" mode="single" :list="fencelist" @confirm="confirmfence"
                            :searchShow="true"></tn-select>
                    </u-form-item>
 
                    <u-form-item :label="'相对高度:'" borderBottom ref="item1" :labelWidth="labelWidth">
                        <tn-input v-show="xdgao!=''" v-model="xdgao" inputAlign="right"></tn-input>
                        <!-- <uni-tooltip :content="content" placement="top" style="width:100px"> -->
                        <u-button v-show="xdgao!=''" slot="right" type="warning" text="删除" size="mini"
                            @click="degao"></u-button>
                        <u-button style="width:100px" type="primary" v-show="xdgao==''" size="mini"
                            @click="acquisitionxy()">校准高度</u-button>
                        <!-- </uni-tooltip> -->
                    </u-form-item>
 
 
                </u--form>
            </view>
        </u-modal>
        <successCom ref="refSuccess" style="position: absolute;z-index: 9999999999999999;"></successCom>
    </view>
</template>
 
<script>
    import successCom from '@/components/success.vue'
    import {
        updateperhe,
        findtagid,
        findAllFence,
        acquisition
    } from '@/config/api.js';
    import {
        minLogin
    } from '@/js/minLogin.js'
    export default {
        components: {
            successCom
        },
        mixins: [minLogin],
        data() {
            return {
                fencegao: '',
                fencename: '',
                showfname: false,
                tagid: '',
                xdgao: '',
                labelWidth: 100,
                tagonlie: '',
                tagidlist: [],
                fencelist: [],
                showtagid: false,
                code: '',
                show: false,
                jiaozhungao: 0,
                gao: 0,
            }
        },
        props: {
            perlist: {
                type: Object,
                default: () => {
                    return []
                }
            }
        },
        mounted() {
            this.findtagidall()
            this.findfenceall()
            this.tagid = this.perlist.tagid
            if (this.perlist.baoliu4 != '' && this.perlist.baoliu4 != null) {
                this.xdgao = this.perlist.baoliu4
            }
        },
        methods: {
            degao() {
                this.xdgao = ''
            },
            findtagidall() {
                if (this.vuex_is_login) {
                    const params = {
                        company: this.company,
                        juese: uni.getStorageSync('juese'),
                    }
                    findtagid(params).then((res) => {
                        if (res.code == 0) {
                            this.tagidlist = res.data.map(item => ({
                                value: item.online,
                                label: item.tagid,
 
                            }));
                        } else {
                            this.$refs.refSuccess.showBox({
                                type: 'error',
                                txt: res.msg
                            });
                        }
                    })
                }
 
            },
 
            findfenceall() {
                if (this.vuex_is_login) {
                    const params = {
                        company: this.company,
                        juese: uni.getStorageSync('juese'),
                    }
                    findAllFence(params).then((res) => {
                        console.log(res);
                        if (res.code == 0) {
                            this.fencelist = res.data.map(item => ({
                                value: item.baoliu4 == '0' ? '0.00' : item.baoliu4,
                                label: item.name,
 
                            }));
                            console.log(this.fencelist);
                        } else {
                            this.$refs.refSuccess.showBox({
                                type: 'error',
                                txt: res.msg
                            });
                        }
                    })
                }
 
            },
 
            acquisitionxy() {
                if (this.code != '') {
                    const params = {
                        baoliu3: this.code,
                        company: this.company,
                        juese: uni.getStorageSync('juese'),
                    }
                    if (this.vuex_is_login) {
                        acquisition(params).then((res) => {
                            if (res.code == 0) {
                                this.xdgao = res.data.height
                            } else {
                                this.$refs.refSuccess.showBox({
                                    type: 'error',
                                    txt: res.msg
                                });
                            }
                        })
                    }
                } else {
                    this.xdgao = this.fencegao
                }
            },
            confirmtagid(e) {
                this.code = e[0].label
                // this.tagonlie = e[0].value
                // this.seachcode()
 
            },
            confirmfence(e) {
                this.fencename = e[0].label
                this.fencegao = e[0].value
            },
            cancelmodal() {
                this.show = false
            },
            startdraw() {
                var json = {}
                json.tagid = this.tagid
                json.baoliu4 = this.xdgao
                updateperhe(json).then((res) => {
 
                })
                this.show = false
            },
            calibration(e) {
                this.show = true
                // this.jiaozhungao = e
                // this.jisuan()
            },
            jisuan(e) {
                // console.log(e);
                // console.log(e.baoliu4);
                // if (e.baoliu4 == '' || e.baoliu4 == null) {
                //     if (e.baoliu3 == '' || e.baoliu3 == null) {
                //         this.gao = 0
                //     } else {
                //         this.gao = (parseFloat(e.height) - parseFloat(e.baoliu3)).toFixed(2)
                //     }
 
                // } else {
                //     this.gao = (parseFloat(e.height) - parseFloat(e.baoliu4)).toFixed(2)
                // }
                // return this.gao
 
                // if (e.baoliu2.split(";")[1] == 0) {
                //     if (e.baoliu4 == '' || e.baoliu4==null) {
                //         this.gao = 0
                //     } else{
                //         this.gao = (parseFloat(e.height) -parseFloat(e.baoliu4)).toFixed(2)
                //     }
                // }else{
                //     console.log(111111);
                //     if (e.baoliu3) {
 
                //     } else{
 
                //     }
                // }
                // console.log(e.baoliu2);
                // console.log(e.baoliu2.split(";")[1]);
                if (e.baoliu2.split(";")[1] == '-1') {
                    if (e.baoliu4 == '' || e.baoliu4 == null) {
                        // if (e.baoliu3 == '' || e.baoliu3 == null) {
                        this.gao = 0
                        // } else {
                        //     this.gao = (parseFloat(e.height) - parseFloat(e.baoliu3)).toFixed(2)
                        // }
 
                    } else {
                        console.log(111111);
                        this.gao = (parseFloat(e.height) - parseFloat(e.baoliu4)).toFixed(2)
                    }
                } else {
                    this.gao = parseFloat(e.baoliu3).toFixed(2)
                    // if (e.baoliu3 == '' || e.baoliu3 == null) {
                    //     this.gao = 0
                    // } else {
                    //     this.gao = (parseFloat(e.height) - parseFloat(e.baoliu3)).toFixed(2)
                    // }
 
 
                }
                return this.gao
 
            },
            getGpsStatusText(status) {
                switch (status) {
                    case '4':
                        return '高精度';
                    case '3':
                        return '无效GPS';
                    case '2':
                        return '码差分';
                    case '1':
                        return '单点定位';
                    case '0':
                        return '初始化';
                    case '5':
                        return '浮点解';
                    case '6':
                        return '正在估算';
                    case '7':
                        return '人工输入固定值';
                    case '8':
                        return '模拟模式';
                    case '9':
                        return 'WAAS差分';
                    default:
                        return '未知状态';
                }
            },
            closeinfo() {
                this.$emit('closePerson')
            },
            copyInfo() {
                //编号,经度纬度,高程
                uni.setClipboardData({
                    data: this.perlist.tagid + ';' + this.perlist.lat + ';' + this.perlist.lon + ";" +
                        this.perlist.height,
                    success: function() {
                        uni.showToast({
                            title: '复制成功',
                            icon: 'success',
                            duration: 2000
                        });
                    }
                });
            },
            refresh() {
                this.$emit('refreshPerson');
            },
            toPage(url) {
                if (url) {
                    let isLogin = this.checkLogin()
                    if (isLogin) {
                        return false;
                    }
                    uni.navigateTo({
                        url: url
                    });
                }
 
            }
        }
    }
</script>
 
<style scoped lang="scss">
    .icon-image {
        top: 5px;
        width: 25px;
        /* 或者你需要的尺寸 */
        height: 25px;
        /* 或者你需要的尺寸 */
    }
 
    .link-box {
        width: 90%;
        margin-left: 10%;
        background-color: #fff;
        border-radius: 8px;
        padding: 10px 0;
    }
 
    .content-box {
        margin-top: 10px;
        width: 100%;
        background-color: #e6e6e6;
        border-radius: 8px;
        padding: 10px 0;
    }
 
    .info-box {
        width: 100%;
        background-color: #ffffff;
        border-radius: 8px;
        padding: 10px 0;
    }
 
    .bu-box {
        display: flex;
        width: 100%;
        background-color: #ffffff;
        border-radius: 8px;
        padding: 10px 0;
    }
 
    .link-left {
        display: flex;
        align-items: center;
    }
 
    .link-bottom {
        min-height: 42px;
        padding: 0 10px;
        // display: flex;
        align-items: center;
        justify-content: space-between;
    }
 
    .link-bottom-border {
        border-top: 1px solid rgba(35, 35, 35, 0.1);
    }
 
    .userinfo-box {
        // padding: 0 15px;
        // margin-top: 20px;
        display: flex;
 
        .userinfo-img {
            // padding-left: 15px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
 
        .userinfo-value-box {
            padding-left: 5px;
 
            .user-nickname {
                height: 28px;
                font-size: 15px;
                font-weight: bold;
                color: #000000;
            }
 
            .user-company {
                height: 22px;
                font-size: 12px;
                color: rgba(35, 35, 35, 0.7);
            }
        }
    }
</style>