fei.wang
8 天以前 645834e1c3efb3a8c50dcbda98d87caba04bd421
pages/index/ditu.vue
@@ -1,5 +1,5 @@
<template>
   <view>
   <view class="container">
      <u-search v-show="show" class="searchbg" shape="true" bg-color="rgba(255, 255, 255, 0.5)" placeholder="请输入名称"
         :show-action="false" v-model="keyword" @search="searchxinxi"
         :style="{top: topheight+'px',position: 'absolute',width: '50%',left: '25%'}"></u-search>
@@ -27,7 +27,7 @@
         <div class="area"
            style="display: inline-block;font-weight: bolder;font-size: 16px;background-color: #000000;color: #ffffff;">
            <image src="../../static/img/blue.png"
               style="vertical-align: middle;position: relative;top: -2px;width:20px;height:20px"> 施工区</image>
               style="vertical-align: middle;position: relative;top: -2px;width:20px;height:20px"> 工作区</image>
         </div>
         <div class="area"
            style="display: inline-block;font-weight: bolder;font-size: 16px;background-color: #000000;color: #ffffff;">
@@ -63,11 +63,15 @@
         <view style="max-height: 600px; overflow-y: auto;">
            <u--form style="" labelPosition="left" :model="model" :rules="rules2" ref="uForm">
               <u-form-item required label="终端编号:" borderBottom ref="item1" labelWidth="80px">
               <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="请选择终端编号" />
                  <!-- <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>
@@ -101,7 +105,7 @@
                     <u-number-box v-model="tanum" :min="2" :max="4   " @change="valChange"></u-number-box>
                  </u-form-item>
                  <view v-for="i in tanum" :key="i">
                     <u-form-item :label="'塔' + (i) + '边缘坐标A:'" borderBottom ref="item1" labelWidth="80px">
                     <u-form-item :label="'塔' + (i) + '导线边缘坐标A:'" borderBottom ref="item1" labelWidth="80px">
                        <tn-input v-show="zuobiaolist[i-1][0]!=''" v-model="zuobiaolist[i-1][0]"
                           inputAlign="right" style="width:400rpx"></tn-input>
                        <!-- <tn-button v-show="zuobiaolist[i-1][0]==''" backgroundColor="#55aaff" fontColor="#ffffff"
@@ -114,7 +118,7 @@
                              @click="acquisitionxy(i,0,'zb')">采集坐标</u-button>
                        </uni-tooltip>
                     </u-form-item>
                     <u-form-item :label="'塔' + (i) + '边缘坐标B:'" borderBottom ref="item1" labelWidth="80px">
                     <u-form-item :label="'塔' + (i) + '导线边缘坐标B:'" borderBottom ref="item1" labelWidth="80px">
                        <tn-input v-show="zuobiaolist[i-1][1]!=''" v-model="zuobiaolist[i-1][1]"
                           inputAlign="right" style="width:400rpx"></tn-input>
                        <uni-tooltip :content="content" placement="top" style="width:100px">
@@ -175,14 +179,28 @@
            </u-form-item>
            <u-form-item required label="围栏类型:" prop="type" borderBottom ref="item1" :labelWidth="labelWidth">
               <tn-input :disabled="isdisabled" v-model="model.type" type="select" @click="show1 = true"
                  placeholder="请输入选择围栏类型" />
               <tn-action-sheet :list="typeList" v-model="show1" @click="typeCallback"></tn-action-sheet>
            <u-form-item required label="围栏类型:" prop="type" borderBottom ref="item1" :labelWidth="labelWidth"
               @click="show1 = true">
               <!-- <u-input :disabled="isdisabled" v-model="model.type" type="select"
                  placeholder="请输入选择围栏类型" /> -->
               <u-input v-model="model.type" 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-action-sheet :list="typeList" v-model="show1" @click="typeCallback"></tn-action-sheet> -->
               <tn-select v-model="show1" mode="single" :list="typeList" @confirm="typeCallback"
                  :searchShow="true"></tn-select>
            </u-form-item>
            <u-form-item required label="关联部门:" prop="department" borderBottom ref="item1" :labelWidth="labelWidth">
               <tn-input v-model="model.department" type="select" @click="show2 = true" placeholder="请选择关联部门" />
               <tn-action-sheet :list="bumenList" v-model="show2" @click="bymenCallback"></tn-action-sheet>
            <u-form-item required label="关联部门:" prop="department" borderBottom ref="item1" :labelWidth="labelWidth"
               @click="show2 = true">
               <!-- <u-input v-model="model.department" type="select" @click="show2 = true" placeholder="请选择关联部门" /> -->
               <u-input v-model="model.department" 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-action-sheet :list="bumenList" v-model="show2" @click="bymenCallback"></tn-action-sheet> -->
               <tn-select v-model="show2" mode="single" :list="bumenList" @confirm="bymenCallback"
                  :searchShow="true"></tn-select>
            </u-form-item>
            <u-form-item required label="围栏高度:" prop="height" borderBottom ref="item1" labelWidth="80px">
@@ -198,9 +216,17 @@
            <u-form-item required label="告警语音:" prop="warnmes" borderBottom ref="item1" labelWidth="80px">
               <u--input v-model="model.warnmes" border="none" placeholder="请输入告警语音"></u--input>
            </u-form-item> -->
            <u-form-item required label="电压等级:" prop="dianya" borderBottom ref="item1" labelWidth="80px">
               <tn-input v-model="model.juli" type="select" @click="show4 = true" placeholder="请选择电压等级" />
               <tn-action-sheet :list="rangeLevel" v-model="show4" @click="changeRangeLevel"></tn-action-sheet>
            <u-form-item required label="电压等级:" prop="dianya" borderBottom ref="item1" labelWidth="80px"
               @click="show4 = true">
               <!-- <u-input v-model="model.juli" type="select" @click="show4 = true" placeholder="请选择电压等级" /> -->
               <u-input v-model="model.juli" 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-action-sheet :list="rangeLevel" v-model="show4" @click="changeRangeLevel"></tn-action-sheet> -->
               <tn-select v-model="show4" mode="single" :list="rangeLevel" @confirm="changeRangeLevel"
                  :searchShow="true"></tn-select>
               <!-- <uni-data-select v-model="model.dianya" :localdata="rangeLevel"
                  @change="changeRangeLevel"></uni-data-select> -->
               <!-- <u--input v-model="model.dianya" border="none" placeholder="请输入电压等级"></u--input> -->
@@ -244,16 +270,28 @@
               <u-form-item label="新增点:" borderBottom ref="item1" labelWidth="80px">
                  <u-number-box v-model="pointnum" :min="4" @change="onchange"></u-number-box>
               </u-form-item>
               <view v-for="(item, index) in pointlist" :key="index">
               <!-- <view v-for="(item, index) in pointlist" :key="index">
                  <u-form-item :label="'点' + (index+1) + '坐标:'" borderBottom ref="item1" labelWidth="80px">
                     <tn-input v-show="pointlist[index]!=index" v-model="pointlist[index]"
                        style="width:400rpx"></tn-input>
                     <uni-tooltip :content="pointcontent" placement="top" style="width:100px">
                        <u-button style="width:100px" type="primary" v-if="pointlist[index]==index"
                        <u-button  type="primary" v-if="pointlist[index]==index"
                           :disabled="pointdisabled" size="mini" @click="acquisitionxy(index)">采集坐标</u-button>
                        <u-button style="width:100px" type="primary" v-else-if="pointlist[index]==''"
                        <u-button  type="primary" v-else-if="pointlist[index]==''"
                           :disabled="pointdisabled" size="mini" @click="acquisitionxy(index)">采集坐标</u-button>
                           <tn-input v-else v-model="pointlist[index]"
                              style="width:400rpx"></tn-input>
                     </uni-tooltip>
                  </u-form-item>
               </view> -->
               <view v-for="index in pointnum" :key="index">
                  <u-form-item :label="'点' + (index) + '坐标:'" borderBottom ref="item1" labelWidth="80px">
                     <uni-tooltip :content="pointcontent" placement="top" style="width:100px">
                        <!-- <u-button  type="primary" v-if="pointlist[index]==index"
                           :disabled="pointdisabled" size="mini" @click="acquisitionxy(index)">采集坐标</u-button> -->
                        <u-button type="primary" v-if="!pointlist[index-1]" :disabled="pointdisabled"
                           size="mini" @click="acquisitionxy(index-1)">采集坐标</u-button>
                        <tn-input v-else v-model="pointlist[index-1]"></tn-input>
                     </uni-tooltip>
                  </u-form-item>
               </view>
@@ -283,10 +321,12 @@
         :change:threeortwo="mars3d.get3wei" :amapPointData='amapPointData'
         :change:amapPointData="mars3d.getPointData" :amapldrawData='amapldrawData'
         :change:amapldrawData="mars3d.getDrwaData" :amapFencePoints='amapFencePoints'
         :change:amapFencePoints="mars3d.getFenceData" :amapdeFencePoints='amapdeFencePoints'
         :change:amapFencePoints="mars3d.getFenceData" :amapCranePoints='amapCranePoints'
         :change:amapCranePoints="mars3d.getCraneData" :amapdeFencePoints='amapdeFencePoints'
         :change:amapdeFencePoints="mars3d.getFenceDatade" :amapGPSPoints='amapGPSPoints'
         :change:amapGPSPoints="mars3d.getgpsData" :point='point' :change:point="mars3d.getmarsPoint"
         :fenceposition='fenceposition' :change:fenceposition="mars3d.getmarsfencePoint"></div>
         :fenceposition='fenceposition' :change:fenceposition="mars3d.getmarsfencePoint" :ishide='ishide'
         :change:ishide="mars3d.getmarshidemap" :isweimap='isweimap' :change:isweimap="mars3d.getmarsweimap"></div>
      <!-- #endif -->
      <!-- #ifndef APP-PLUS || H5 -->
      <!-- #endif -->
@@ -308,6 +348,7 @@
   } from '@/js/tools.js'
   import successCom from '@/components/success.vue'
   import {
      findAllCrane,
      findtagid,
      findWarnmes,
      submitper,
@@ -338,7 +379,7 @@
            pointlock: false, //踩点获取数据开关
            pointcontent: '',
            pointdisabled: false,
            pointlist: [0, 1, 2, 3],
            pointlist: [],
            pointnum: 4,
            pointdrawshow: false,
            end: false,
@@ -355,16 +396,20 @@
            show1: false,
            show2: false,
            typeList: [{
                  text: '保护区'
                  value: '保护区',
                  label: '保护区'
               },
               {
                  text: '禁入区'
                  value: '禁入区',
                  label: '禁入区'
               },
               {
                  text: '工作区'
                  value: '工作区',
                  label: '工作区'
               },
               {
                  text: '安全区'
                  value: '安全区',
                  label: '安全区'
               },
            ],
            warnmesList: [{
@@ -488,34 +533,34 @@
            stopdatetime: '',
            rangeLevel: [{
               value: '0.95m',
               text: '10kV(0.95m)'
               label: '10kV(0.95m)'
            }, {
               value: '1.05m',
               text: '20kV(1.05m)'
               label: '20kV(1.05m)'
            }, {
               value: '1.15m',
               text: '35kV(1.15m)'
               label: '35kV(1.15m)'
            }, {
               value: '1.4m',
               text: '66kV(1.4m)'
               label: '66kV(1.4m)'
            }, {
               value: '1.65m',
               text: '110kV(1.65m)'
               label: '110kV(1.65m)'
            }, {
               value: '2.55m',
               text: '220kV(2.55m)'
               label: '220kV(2.55m)'
            }, {
               value: '3.25m',
               text: '330kV(3.25m)'
               label: '330kV(3.25m)'
            }, {
               value: '4.66m',
               text: '500kV(4.55m)'
               label: '500kV(4.55m)'
            }, {
               value: '6.70m',
               text: '750kV(6.70m)'
               label: '750kV(6.70m)'
            }, {
               value: '8.25m',
               text: '1000kV(8.25m)'
               label: '1000kV(8.25m)'
            }],
            rules2: {
@@ -642,6 +687,7 @@
            amapendGuijiPoints: '',
            amapGuijiPoints: [],
            amapFencePoints: [],
            amapCranePoints: [],
            amapdeFencePoints: {},
            keyword: '',
            topheight: 55,
@@ -670,21 +716,21 @@
            type: String,
            // default: 60
         },
         ishide: {
            type: Boolean,
         },
         isweimap: {
            type: Boolean,
         },
      },
      onLoad() {
      },
      mounted() {
         console.log(this.fenceposition);
         tts = new AndroidTTSVoice(function(state) {
            // console.log(state)
            // showToast(state+"")
            if (state) {
               tts.listenerVoiceState(function(b) {
                  // console.log(b)
               })
               tts.listenerVoiceState(function(b) {})
            }
         });
         this.getLocation();
@@ -724,9 +770,7 @@
         speaks(text) {
            if (this.isyuyin == true) {
               var tm = this.ptime; //标签上一次下发蜂鸣的时间
               console.log(tm);
               if (tm != '') {
                  console.log(3333333);
                  var a = get_time_cha_s(tm); //上次下发蜂鸣时间和现在时间差
                  var yt = '5'
                  // if (sign=='fg') {
@@ -739,25 +783,11 @@
                     this.ptime = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
                  }
               } else {
                  console.log(22222);
                  var state = tts.speak(text);
                  this.ptime = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
               }
            }
            // tts.speak(res.data[i].tagid + res.data[i].personname +
            //                                        "进入预警区域请注意");
         },
         // updateButtonPosition() {
         //               const windowHeight = window.innerHeight;
         //             console.log(windowHeight);
         //               const windowWidth = window.innerWidth;
         //               this.buttonTop = windowHeight-279 ;
         //               this.buttonLeft = 15;
         //             console.log(this.buttonTop);
         //             },
         findtagidall() {
            if (this.vuex_is_login) {
               const params = {
@@ -765,7 +795,6 @@
                  juese: uni.getStorageSync('juese'),
               }
               findtagid(params).then((res) => {
                  console.log(res);
                  if (res.code == 0) {
                     this.tagidlist = res.data.map(item => ({
                        value: item.online,
@@ -783,43 +812,34 @@
         },
         confirmtagid(e) {
            this.code = e[0].label
            // this.tagonlie = e[0].value
            this.seachcode()
         },
         changeRangeLevel(e) {
            console.log(e);
            // console.log(this.model.juli);
            this.model.juli = this.rangeLevel[e].text;
            // if (this.model.juli != '') {
            this.model.dianya = this.rangeLevel[e].value.split("m")[0]
            // }
            // this.dianya = e;
            // this.model.dianya = e.split("m")[0];
            this.model.juli = e[0].label
            this.model.dianya = e[0].value.split("m")[0]
         },
         getLocation() {
            uni.getLocation({
               type: 'wgs84',
               success: function(res) {
                  console.log('当前位置的经度:' + res.longitude);
                  console.log('当前位置的纬度:' + res.latitude);
               }
            });
         },
         onchange(e) {
            var list = []
            if (this.pointlist.length < e.value) {
               for (var i = this.pointlist.length; i < e.value; i++) {
            // var list = []
            // if (this.pointlist.length < e.value) {
            //    for (var i = this.pointlist.length; i < e.value; i++) {
                  list.push(i)
                  this.pointlist.push(i)
                  // e[i]
               }
            } else {
               this.pointlist.splice(e.value, this.pointlist.length - e.value)
            }
            //       list.push(i)
            //       this.pointlist.push(i)
            //       // e[i]
            //    }
            // } else {
            //    this.pointlist.splice(e.value, this.pointlist.length - e.value)
            // }
         },
         radioChange(n) {
@@ -912,11 +932,10 @@
                  juese: uni.getStorageSync('juese'),
               }
               findbumen(params).then((res) => {
                  console.log(res);
                  if (res.code == 0) {
                     this.bumenList = res.data.map(item => ({
                        value: item.name,
                        text: item.name
                        label: item.name
                     }));
                  } else {
                     this.$refs.refSuccess.showBox({
@@ -928,9 +947,9 @@
            }
         },
         typeCallback(index) {
         typeCallback(e) {
            const params = {
               type: this.typeList[index].text,
               type: e[0].label,
            }
            findWarnmes(params).then((res) => {
               if (res.code == 0) {
@@ -947,10 +966,10 @@
               }
            })
            this.model.type = this.typeList[index].text;
            this.model.type = e[0].label;
         },
         bymenCallback(index) {
            this.model.department = this.bumenList[index].text;
         bymenCallback(e) {
            this.model.department = e[0].label;
         },
         acquisitionxy(index, i, name) {
@@ -959,24 +978,18 @@
               company: this.company,
               juese: uni.getStorageSync('juese'),
            }
            console.log(params);
            if (this.vuex_is_login) {
               acquisition(params).then((res) => {
                  console.log(res);
                  if (res.code == 0) {
                     if (this.model.fencetype == '变电作业') {
                        // this.model.points += res.data.lat + ":" + res.data.lon + ";"
                        this.pointlist.splice(index, 1, res.data.lat + ":" + res.data.lon);
                        console.log(this.pointlist);
                        this.amapPointData.splice(index, 1, res.data);
                        // this.amapPointData.push(res.data)
                        // this.amapPointData = this.pointlist
                        this.pointlock = true
                     } else {
                        console.log(name);
                        if (name == 'zb') {
                           console.log(index);
                           console.log(i);
                           this.zuobiaolist[index - 1][i] = res.data.lat + ":" + res.data.lon + ";"
                           this.zuobiaolist[index - 1][2] = res.data.height
                           this.amapPointData.splice(index + i, 1, res.data);
@@ -998,13 +1011,11 @@
         },
         valChange(e) {
            console.log('当前值为: ' + e.value)
         },
         valChange(e) {},
         initlock() {
            this.fetchPersonsList();
            this.fetchFenceList();
            this.fetchCraneList
         },
         closemodal() {
            this.drawshow = false
@@ -1047,9 +1058,9 @@
               //从最后一条查询点位B第一条塔,第二条弧垂拼接,最后把两组数据拼接起来
               for (let i = this.tanum - 1; i >= 0; i--) {
                  result += this.zuobiaolist[i][1];
                  // if (i >= 1) {
                  //    result += this.saglist[i - 1][1];
                  // }
                  if (i >= 1) {
                     result += this.saglist[i - 1][1];
                  }
                  // hei += this.zuobiaolist[i][2];
                  // if (i >= 1) {
@@ -1061,16 +1072,25 @@
                  //    hei += this.saglist[i - 1][2] + ":" + this.saglist[i - 1][3] + ';';
                  // }
               }
               console.log(result);
               console.log(hei);
               this.model.points = result
               this.model.lineHeight = hei
            } else {
               let result = '';
               for (var i = 0; i < this.pointlist.length; i++) {
                  result += this.pointlist[i] + ";"
               if (this.drawway == "连续绘制") {
               } else {
                  // this.drawway == "连续绘制"
                  let result = '';
                  for (var i = 0; i < this.pointlist.length; i++) {
                     result += this.pointlist[i] + ";"
                  }
                  this.model.points = result
               }
               this.model.points = result
               // this.drawway == "连续绘制"
               // let result = '';
               // for (var i = 0; i < this.pointlist.length; i++) {
               //    result += this.pointlist[i] + ";"
               // }
               // this.model.points = result
            }
            this.$refs.uForm.validate().then(res => {
@@ -1081,7 +1101,66 @@
                        type: 'success',
                        txt: "保存成功"
                     });
                     this.pointlist = [],
                        // list: [
                        //    [
                        //       0, 1
                        //    ],
                        //    [
                        //       2, 3
                        //    ],
                        //    [
                        //       4, 5
                        //    ]
                        // ],
                        this.zuobiaolist = [
                           [
                              '', '', '', ''
                           ],
                           // height1:'',
                           [
                              '', '', '', ''
                           ],
                           [
                              '', '', '', ''
                           ],
                           // height1:'',
                           [
                              '', '', '', ''
                           ],
                           // height3:'',
                        ],
                        this.saglist = [
                           [
                              '', '', '', ''
                           ],
                           [
                              '', '', '', ''
                           ],
                           [
                              '', '', '', ''
                           ],
                           // height3:'',
                        ],
                        this.model.point = ''
                     this.model.fenceFloorHe = '-1'
                     this.model.height = ''
                     this.model.lineHeight = '-1'
                     this.model.company = this.company
                     this.model.perCompany = ''
                     this.model.addperson = this.username
                     this.model.name = ''
                     this.model.juli = ''
                     this.model.type = ''
                     this.model.department = ''
                     this.model.distance = '0'
                     this.model.dianya = ''
                     this.model.isplay = '0'
                     this.model.nowarnmes = ''
                     this.model.warnmes = ''
                     this.model.fencetype = '变电作业'
                     this.savefence = false
                     this.amapldrawData = []
                     this.amapPointData = []
@@ -1158,8 +1237,16 @@
            this.pointdrawshow = false
         },
         savepoint() {
            this.pointdrawshow = false
            this.savefence = true
            if (this.pointlist.length < 3) {
               this.$refs.refSuccess.showBox({
                  type: 'error',
                  txt: '请先采集点位'
               });
            } else {
               this.pointdrawshow = false
               this.savefence = true
            }
         },
         fenceHe() {
            //获取围栏底高
@@ -1197,6 +1284,7 @@
            this.fetchPersonsList();
            this.updateTrajectories();
            this.fetchFenceList();
            this.fetchCraneList()
         },
         searchxinxi() {
            const params = {
@@ -1237,6 +1325,53 @@
            })
            // }
         },
         fetchCraneList() {
            const params = {
               company: this.company,
               juese: uni.getStorageSync('juese'),
            }
            if (this.vuex_is_login) {
               if (uni.getStorageSync('isfence') == true) {
                  findAllCrane(params).then((res) => {
                     if (res.data != null) {
                        // const filteredData = res.data.filter(item => item.ishide === "1");
                        // if (filteredData != null) {
                        //    this.amapdeFencePoints = filteredData
                        // }
                        // const filteredDatap = res.data.filter(item => item.isplay === "1");
                        // if (filteredDatap != null) {
                        //    this.amapdeFencePoints = filteredDatap
                        // }
                        // const filteredDatapt = res.data.filter(item => item.isplay === "0");
                        // if (filteredDatapt != null) {
                        //    this.amapdeFencePoints = filteredDatapt
                        // }
                        //                if (this.amapFencePoints.length > res.data.length) {
                        //                   //当有围栏删除时调用地图把围栏全部删除
                        //                   const missingData = this.amapFencePoints.filter(item1 => {
                        //                      return !res.data.some(item2 => item2.id === item1.id);
                        //                   });
                        //                   this.amapdeFencePoints = missingData
                        //                }
                        this.amapCranePoints = res.data
                     }
                  })
               } else {
                  this.amapCranePoints = []
               }
            }
            setTimeout(() => {
               //5秒播放一次
               this.fetchCraneList();
            }, 5000);
         },
         fetchFenceList() {
            const params = {
               company: this.company,
@@ -1246,20 +1381,20 @@
               if (uni.getStorageSync('isfence') == true) {
                  findAllFence(params).then((res) => {
                     if (res.data != null) {
                        const filteredData = res.data.filter(item => item.ishide === 1);
                        const filteredData = res.data.filter(item => item.ishide === "1");
                        if (filteredData != null) {
                           this.amapdeFencePoints = filteredData
                        }
                        const filteredDatap = res.data.filter(item => item.isplay === "1");
                        if (filteredDatap != null) {
                           this.amapdeFencePoints = filteredDatap
                        }
                        // const filteredDatap = res.data.filter(item => item.isplay === "1");
                        // if (filteredDatap != null) {
                        //    this.amapdeFencePoints = filteredDatap
                        // }
                        const filteredDatapt = res.data.filter(item => item.isplay === "0");
                        if (filteredDatapt != null) {
                           this.amapdeFencePoints = filteredDatapt
                        }
                        // const filteredDatapt = res.data.filter(item => item.isplay === "0");
                        // if (filteredDatapt != null) {
                        //    this.amapdeFencePoints = filteredDatapt
                        // }
                        if (this.amapFencePoints.length > res.data.length) {
                           //当有围栏删除时调用地图把围栏全部删除
                           const missingData = this.amapFencePoints.filter(item1 => {
@@ -1354,7 +1489,6 @@
                                    "超高请注意");
                                 // this.warntype = "error"
                              }
                              console.log(this.warnidlist.indexOf(res.data[i].tagid));
                              if (this.warnidlist.indexOf(res.data[i].tagid) < 0) {
                                 if (res.data[i].warnstatus == '1') {
                                    this.warnlist.push(res.data[i].tagid + res.data[i].personname +
@@ -1463,6 +1597,7 @@
<script module="mars3d" lang="renderjs">
   let graphicLayer = null;
   let graphicLayerFence = null;
   let graphicLayerCrane = null;
   let graphicLayerFenceBianJie = null;
   let graphicLayerFencedrwa = null;
   var creditHtml = ''
@@ -1470,6 +1605,7 @@
   let addedCarIds = new Set();
   let addedBaseIds = new Set();
   let addedFenceIds = new Set();
   let addedCraneIds = new Set();
   var LocusData;
   var LocuData;
   var countNum = 0;
@@ -1513,6 +1649,8 @@
            fenceids: '',
            graphicids: [],
            graphicFence: {},
            graphicCrane: {},
            labels: {},
            list: {},
            perlist: {},
@@ -1543,15 +1681,15 @@
            // "http://123.56.113.213:8080/hxzkuwb/Home/demo/lib/mars3d/mars3d.css",
            // "http://123.56.113.213:8080/hxzkuwb/Home/demo/lib/mars3d/mars3d.js",
            // "http://123.56.113.213:8080/hxzkuwb/Home/js/3DMoXing.js",
            "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Widgets/widgets.css",
            "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Cesium.js",
            "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.css",
            "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.js",
            // "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Widgets/widgets.css",
            // "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Cesium.js",
            // "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.css",
            // "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.js",
            // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/Cesium/Widgets/widgets.css",
            // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/Cesium/Cesium.js",
            // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.css",
            // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.js",
            "http://123.117.152.120:8088/IAFService/view/Home/demo/lib/Cesium/Widgets/widgets.css",
            "http://123.117.152.120:8088/IAFService/view/Home/demo/lib/Cesium/Cesium.js",
            "http://123.117.152.120:8088/IAFService/view/Home/demo/lib/mars3d/mars3d.css",
            "http://123.117.152.120:8088/IAFService/view/Home/demo/lib/mars3d/mars3d.js",
            //用在线地址
            // "http://mars3d.cn/lib/Cesium/Widgets/widgets.css",
            // "http://mars3d.cn/lib/Cesium/Cesium.js", 
@@ -1657,8 +1795,11 @@
                     // center: { lat: mapPosition[1], lng: mapPosition[0], alt: HomeSetting.alt, heading: HomeSetting.heading, pitch: HomeSetting.pitch },
                     showSkyAtmosphere: false, // 关闭球周边的白色轮廓 map.scene.skyAtmosphere = false
                     fog: true,
                     backgroundImage: "url(http://123.117.152.120:8088/IAFService/view/Home/gdty/background.png)",
                     fxaa: true,
                     globe: {
                        show: true,
                        showGroundAtmosphere: false, // 关闭大气(球表面白蒙蒙的效果)
                        depthTestAgainstTerrain: false,
                        baseColor: "#546a53"
@@ -1898,16 +2039,20 @@
                  map.scene.morphTo2D(0);
               }
               // 创建矢量数据图层
               graphicLayer = new mars3d.layer.GraphicLayer({
                  allowDrillPick: true // 如果存在坐标完全相同的图标点,可以打开该属性,click事件通过graphics判断
               })
               // showCarList()       //加载人员数据
               graphicLayerFencedrwa = new mars3d.layer.GraphicLayer()
               map.addLayer(graphicLayerFencedrwa)
               graphicLayerCrane = new mars3d.layer.GraphicLayer()
               map.addLayer(graphicLayerCrane)
               graphicLayerFenceBianJie = new mars3d.layer.GraphicLayer()
               map.addLayer(graphicLayerFenceBianJie)
               graphicLayerFence = new mars3d.layer.GraphicLayer()
               map.addLayer(graphicLayerFence)
               graphicLayer = new mars3d.layer.GraphicLayer({
                  // allowDrillPick: true ,// 如果存在坐标完全相同的图标点,可以打开该属性,click事件通过graphics判断
               })
@@ -1931,6 +2076,9 @@
                  json.online = car.attr.online
                  json.baoliu1 = car.attr.baoliu1
                  json.baoliu3 = car.attr.baoliu3
                  json.baoliu2 = car.attr.baoliu2
                  json.baoliu4 = car.attr.baoliu4
                  json.type = car.attr.type
                  json.rtcm = car.attr.rtcm
                  json.tagid = car.attr.tagid
@@ -1940,11 +2088,17 @@
                  json.height = car.attr.height
                  json.department = car.attr.department
                  json.gpsstatus = car.attr.gpsstatus
                  this.perlist = json
                  this.$ownerInstance.callMethod('handleMapClick', this.perlist);
               })
               // setTimeout(() => {
               graphicLayerFence = new mars3d.layer.GraphicLayer();
               map.addLayer(graphicLayerFence)
               //测试本地图片 
               // const graphic = new mars3d.graphic.BillboardEntity({
@@ -1977,14 +2131,20 @@
               });
            }
         },
         getmarshidemap(newValue) {
            map.globe.show = !newValue;
         },
         getmarsweimap(newValue) {
            if (newValue == true) {
               map.scene.morphTo3D(0);
            } else {
               map.scene.morphTo2D(0);
            }
            // map.globe.show = !newValue;
         },
         getmarsfencePoint(newValue) {
            console.log(444444444444);
            console.log(newValue);
            console.log(newValue.split(",")[0]);
            // if (this.fenceplock == false) {
            setTimeout(() => {
               // if (this.fplock == true) {
               //5秒播放一次
               if (Object.keys(newValue).length != 0) {
                  map.camera.flyTo({
@@ -2006,7 +2166,7 @@
         getFenceDatade(newValue) {
            if (Object.keys(newValue).length != 0) {
               graphicLayerFence.clear()
               console.log(111111111111);
               addedFenceIds = new Set();
               // if (this.fenceid == newValue.id) {
               graphicLayerFenceBianJie.clear()
@@ -2031,11 +2191,130 @@
            return R * c;
         },
         getCraneData(newValue) {
            console.log(newValue);
            if (Object.keys(newValue).length != 0) {
               newValue.forEach((e, i) => {
                  // if (e.ishide === '0') {
                  // if (!addedCraneIds.has(e.id)) {
                  console.log("打印数据====》》》》》》》》-----");
                  // this.fenceids = e.id + "_fence"
                  console.log(e);
                  // const {
                  //    oldgraphic,
                  //    // label
                  // } = this.graphicCrane[e.id];
                  console.log(this.graphicCrane[e.id]);
                  // 移除旧的图标实体
                  if (this.graphicCrane[e.id]) {
                     graphicLayerCrane.removeGraphic(this.graphicCrane[e.id].oldgraphic);
                     // graphicLayer.removeGraphic(label);
                  }
                  let parts = e.pointA.split(',');
                  var part = []
                  // var fence = []
                  var positions = [];
                  // part = e.split(',');
                  // if (part.length > 1) {
                  var lng = parseFloat(parts[0]);
                  var lat = parseFloat(parts[1]);
                  part.push(lng)
                  part.push(lat)
                  positions.push(part);
                  console.log(positions);
                  const fenceGraphic = new mars3d.graphic.Sector({
                     // pointA
                     positions: positions,
                     // [
                     //    [117.151322, 31.863556, 34.3]
                     //    // positions
                     //    // [117.18186,31.869359, 29.8],
                     //    // [117.17505, 31.84342, 105.7],
                     // ],
                     pickable: false,
                     style: {
                        radius: e.radius,
                        startAngle: e.angle, // 开始角度(正东方向为0,顺时针到360度)
                        endAngle: 0,
                        // closure: true,
                        color: "#3388ff",
                        opacity: 0.5,
                        clampToGround: true,
                        // outline: true,
                        // outlineWidth: 3,
                        // outlineColor: "#ffffff",
                        // diffHeight: e.height / 100,
                        // clampToGround:true,
                        // // addHeight:10,
                        // materialType: mars3d.MaterialType.LineFlow,
                        label: {
                           text: e.cranename,
                           font_size: 18,
                           outline: true,
                           visibleDepth: true,
                           // outlineColor: colorFence,
                           color: "#ffffff",
                           distanceDisplayCondition: true,
                           distanceDisplayCondition_far: 500000,
                           distanceDisplayCondition_near: 0,
                        }
                     },
                     // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]],
                     // style: {
                     //    color: this.parseColor("#FF0000").withAlpha(0.3),
                     //    outlineWidth: 2, // 边框粗细(像素)
                     //    outline: true,
                     //    outlineColor: this.parseColor("#b40000"),
                     //    // diffHeight: newValue[e].height || 0,
                     //    label: {
                     //       text: e.name,
                     //       font_size: 18,
                     //       outline: true,
                     //       outlineColor: "#C70708",
                     //       color: "#ffffff",
                     //       distanceDisplayCondition: true,
                     //       distanceDisplayCondition_far: 500000,
                     //       distanceDisplayCondition_near: 0
                     //    }
                     // },
                     attr: {
                        name: e.cranename,
                        // ptagid: newValue[e].id,。
                     }
                  });
                  graphicLayerCrane.addGraphic(fenceGraphic);
                  addedCraneIds.add(e.id);
                  this.graphicCrane[e.id] = {
                     // graphic: graphic,
                     oldgraphic: fenceGraphic
                  };
                  // } else {
                  //    // if (addedFenceIds.has(e.id)) {
                  //    //    graphicLayer.removeGraphic(graphic);
                  //    //    delete this.graphicLabels[e.id]; // 删除引用
                  //    //    // delete this.labels[e.id];
                  //    //    addedFenceIds.delete(e.id);
                  //    //    // this.graphicLabels[e.anchorid] = {
                  //    //    //    graphic: graphic1
                  //    //    // };
                  //    // }
                  // }
                  // }
               }) // 将传递过来的值赋值给points,这样就可以在视图层中使用
            } else {
               addedCraneIds = new Set();
            }
         },
         getFenceData(newValue) {
            console.log(newValue);
            if (Object.keys(newValue).length != 0) {
               newValue.forEach((e, i) => {
                  if (e.ishide === '0') {
                     if (!addedFenceIds.has(e.id)) {
                        console.log("打印数据====》》》》》》》》");
                        this.fenceids = e.id + "_fence"
                        // setTimeout(() => {
                        //5秒播放一次
@@ -2072,7 +2351,8 @@
                                 image: "static/img/ponit1.png",
                                 scale: 0.4,
                                 horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                 verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                                 verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                                 visibleDepth: false
                              }
                              // attr: {
                              //    online: newValue[e].online,
@@ -2117,6 +2397,7 @@
                                 visibleDepth: false,
                                 horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                 visibleDepth: false, //是否被遮挡
                                 verticalOrigin: Cesium.VerticalOrigin.CENTER
                              }
                           });
@@ -2149,16 +2430,20 @@
                        const fenceGraphic = new mars3d.graphic.PolygonPrimitive({
                           positions: fence,
                           pickable: false,
                           style: {
                              closure: true,
                              color: colorFence,
                              opacity: 0.5,
                              diffHeight: e.height / 100,
                              clampToGround: true,
                              // addHeight:10,
                              materialType: mars3d.MaterialType.LineFlow,
                              label: {
                                 text: e.name + "(" + qt + ")",
                                 font_size: 18,
                                 outline: true,
                                 visibleDepth: true,
                                 outlineColor: colorFence,
                                 color: "#ffffff",
                                 distanceDisplayCondition: true,
@@ -2191,8 +2476,6 @@
                        });
                        graphicLayerFence.addGraphic(fenceGraphic);
                        addedFenceIds.add(e.id);
                        console
                           .log(this.graphicFence);
                        this.graphicFence[this.fenceids] = {
                           // graphic: graphic,
                           fence: fenceGraphic
@@ -2234,9 +2517,7 @@
            if (Object.keys(newValue).length != 0) {
               for (var e = newValue.length - 1; e < newValue.length; e++) {
                  this.fenceid = newValue[e].id
                  if (newValue[e - 1].lat != undefined && newValue[e].lat == newValue[e - 1].lat) {
                     console.log("数据重复===========》》》》》》》》", newValue[e].lat);
                  } else {
                  if (newValue[e - 1].lat != undefined && newValue[e].lat == newValue[e - 1].lat) {} else {
                     //     // 3. 闭合多边形
                     this.cartesianPoints.push(newValue[e]);
@@ -2285,30 +2566,7 @@
                  this.cartesianPoints.push(this.plist);
                  // 自动闭合多边形
                  // [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]]
                  const fenceGraphic = new mars3d.graphic.PolygonPrimitive({
                     positions: this.cartesianPoints,
                     // id: newValue[e].id,
                     // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]],
                     style: {
                        color: this.parseColor("#FF0000").withAlpha(0.3),
                        outlineWidth: 2, // 边框粗细(像素)
                        outline: true,
                        outlineColor: this.parseColor("#b40000"),
                        diffHeight: newValue[e].height || 0,
                        // label: {
                        //   text: e.name,
                        //   font_size: 14,
                        //   color: Cesium.Color.WHITE,
                        //   distanceDisplayCondition: [0, 500000]
                        // }
                     }
                  });
                  // this.graphicFence[newValue[e].id] = {
                  //    // graphic: graphic,
                  //    fence: fenceGraphic
                  // };
                  graphicLayerFencedrwa.addGraphic(fenceGraphic);
                  //测试本地图片
                  // this.graphicids.push(newValue[e].id)
                  const graphic = new mars3d.graphic.BillboardEntity({
@@ -2322,7 +2580,7 @@
                        image: "static/img/ponit1.png",
                        scale: 0.4,
                        horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                        verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                        verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                     },
                     attr: {
                        online: newValue[e].online,
@@ -2344,9 +2602,31 @@
                  //    // fence: fenceGraphic
                  // };
               }
            } else {
               console.log("清空绘制围栏");
            }
               const fenceGraphic = new mars3d.graphic.PolygonPrimitive({
                  positions: this.cartesianPoints,
                  // id: newValue[e].id,
                  // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]],
                  style: {
                     color: this.parseColor("#FF0000").withAlpha(0.3),
                     outlineWidth: 2, // 边框粗细(像素)
                     outline: true,
                     outlineColor: this.parseColor("#b40000"),
                     diffHeight: newValue[e].height || 0,
                     // label: {
                     //   text: e.name,
                     //   font_size: 14,
                     //   color: Cesium.Color.WHITE,
                     //   distanceDisplayCondition: [0, 500000]
                     // }
                  }
               });
               // this.graphicFence[newValue[e].id] = {
               //    // graphic: graphic,
               //    fence: fenceGraphic
               // };
               graphicLayerFencedrwa.addGraphic(fenceGraphic);
            } else {}
         },
         getData(newValue) {
            let modelParam = {
@@ -2359,7 +2639,6 @@
               newValue.forEach((e, i) => {
                  if (e.online === '1') {
                     if (!addedCarIds.has(e.id)) {
                        // console.log("打印数据====》》》》》》》》》》");
                        //测试本地图片
                        let colorFence = ""
                        let JuXingcolorFence = ""
@@ -2411,12 +2690,15 @@
                              image: img,
                              scale: "0.4",
                              horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                              verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                              verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                           },
                           attr: {
                              online: e.gpsstatus,
                              type: e.type,
                              baoliu1: e.baoliu1,
                              baoliu3: e.baoliu3,
                              baoliu2: e.baoliu2,
                              baoliu4: e.baoliu4,
                              rtcm: e.rtcm,
                              encryption: e.encryption,
                              power: e.power,
@@ -2438,7 +2720,7 @@
                              style: Cesium.LabelStyle.FILL_AND_OUTLINE, // 风格:填充和描边
                              verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 文字在垂直方向的原点
                              pixelOffset: new Cesium.Cartesian2(0, -
                                 30) // 文字偏移量,向下偏移10像素
                                 75) // 文字偏移量,向下偏移10像素
                           }
                        });
                        if (this.graphicLabels[e.id]) {
@@ -2486,12 +2768,15 @@
                                 image: img,
                                 scale: "0.4",
                                 horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                 verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                                 verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                              },
                              attr: {
                                 online: e.gpsstatus,
                                 type: e.type,
                                 baoliu1: e.baoliu1,
                                 baoliu3: e.baoliu3,
                                 baoliu2: e.baoliu2,
                                 baoliu4: e.baoliu4,
                                 rtcm: e.rtcm,
                                 encryption: e.encryption,
                                 power: e.power,
@@ -2572,14 +2857,6 @@
                              // var img = "static/img/zuobiao2.png";
                              colorFence = "#ffff00"
                           }
                           // console.log(22222222);
                           // console.log(item.baoliu2);
                           // console.log(item.baoliu2.split(";").indexOf("1"));
                           // console.log(item.baoliu2.split(";").indexOf("1")>-1);
                           // if (item.baoliu2.split(";").indexOf("1") < 0) {
                           //    var img = "static/img/zuobiao7.png";
                           //    // var img = "static/img/zuobiao2.png";
                           // }
                           if (item.baoliu2.split(";")[0] == 1) {
                              var img = "static/img/zuobiao6.png";
                           } else if (item.baoliu2.split(";")[1] == 0) {
@@ -2602,7 +2879,8 @@
                                 scale: "0.4",
                                 horizontalOrigin: Cesium.HorizontalOrigin
                                    .CENTER,
                                 // addHeight:1000,
                                 visibleDepth: false, //是否被遮挡
                                 verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                                 // pixelOffset: new Cesium.Cartesian2(0, 10), // 向下偏移50像素
                              },
@@ -2610,6 +2888,9 @@
                                 online: item.online,
                                 type: item.type,
                                 baoliu1: item.baoliu1,
                                 baoliu3: item.baoliu3,
                                 baoliu2: item.baoliu2,
                                 baoliu4: item.baoliu4,
                                 encryption: item.encryption,
                                 rtcm: item.rtcm,
                                 power: item.power,
@@ -2630,7 +2911,7 @@
                                 outlineWidth: 2,
                                 style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                                 verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                                 pixelOffset: new Cesium.Cartesian2(0, -30)
                                 pixelOffset: new Cesium.Cartesian2(0, -75)
                              }
                           });
                           // 添加标签到图层并存储引用
@@ -2730,6 +3011,15 @@
</script>
<style>
   .container {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
      background: url("../../static/img/background.png") no-repeat;
      background-size: 100% 100%;
   }
   .searchbg {
      width: '50%';
      left: '25%';