fei.wang
7 天以前 645834e1c3efb3a8c50dcbda98d87caba04bd421
pages/index/fence.vue
@@ -2,31 +2,60 @@
   <view class="template-job tn-safe-area-inset-bottom tn-skeleton">
      <!-- 顶部自定义导航 -->
      <tn-nav-bar :isBack="false" fixed style="position: absolute;z-index: 999999999;">
      <tn-nav-bar fixed style="position: absolute;z-index: 999999999;" alpha customBack>
         <view v-show="type=='2'" slot="right" class='tn-custom-nav-bar__back' @click="goBack">
            <text style="margin-right: 20px;">新增</text>
            <!-- <text class='tn-icon add'></text> -->
         </view>
         <!-- <text class="title_linespan" @click="goTag">绘制</text> -->
         <text v-if="isAchor==false" class="title_linespan"
            style="margin-left: 10px;" @click="goAchor">围栏管理</text>
         <text v-if="isAchor==false" class="title_linespan" style="margin-left: 10px;" @click="goAchor">围栏管理</text>
         <text v-else class="title_linespan" style="margin-left: 10px;" @click="goAchor">围栏管理</text>
      </tn-nav-bar>
      <!--    <view class="title_linespan"
         style="margin-top: 100px;position: absolute;z-index: 9999999999999;margin-left:10%;"
         :style="{color: color,'text-decoration': decoration}" @click="gotype('0')">变电作业</view>
      <view style="margin-top: 100px;position: absolute;z-index: 9999999999999;margin-left:40%;"
         class="title_linespan" @click="gotype('1')">输电作业</view>
      <view style="margin-top: 100px;position: absolute;z-index: 9999999999999;margin-left: 70%;"
         class="title_linespan" @click="gotype('2')">吊臂防护</view> -->
      <!-- <view v-show="type=='0'" style="margin-top: 100px;position: absolute;z-index: 9999999;margin-left:10%;   color: #00aaff;
         text-decoration: underline;font-size: 17px;
      font-weight: bold;" @click="gotype('0')">变电作业</view>
      <view v-show="type=='1'" style="margin-top: 100px;position: absolute;z-index: 9999999;margin-left:40%;   color: #00aaff;
         text-decoration: underline;font-size: 17px;
      font-weight: bold;" @click="gotype('1')">输电作业</view>
      <view v-show="type=='2'" style="margin-top: 100px;position: absolute;z-index: 9999999;margin-left: 70%;   color: #00aaff;
         text-decoration: underline;font-size: 17px;
      font-weight: bold;" @click="gotype('2')">吊臂防护</view>
      <view v-show="type!='0'" style="margin-top: 100px;position: absolute;z-index: 9999999;margin-left:10%;font-size: 17px;
      font-weight: bold;" @click="gotype('0')">变电作业</view>
      <view v-show="type!='1'" style="margin-top: 100px;position: absolute;z-index: 9999999;margin-left:40%;font-size: 17px;
      font-weight: bold;" @click="gotype('1')">输电作业</view>
      <view v-show="type!='2'" style="margin-top: 100px;position: absolute;z-index: 99999999;margin-left: 70%;font-size: 17px;
      font-weight: bold;" @click="gotype('2')">吊臂防护</view> -->
      <view v-show="lock==false" class="page-wrap u-skeleton">
         <data-list :width="width" class="data-list" ref="list" @load="handleLoad" @refresh="handleRefresh"
            style="margin-top: 100px;">
         <data-list :width="width"  :handovertype="handovertype" class="data-list" ref="list"
            @load="handleLoad" @refresh="handleRefresh" @handover="handoverData" style="margin-top: 90px;">
            <view class="item-wrap" v-for="(item, index) in list" :key="index">
               <tn-button shape="icon" class="tn-icon-edit" style="position: absolute;left: 85%;" size="lg"
                  @click="editClick(item,index)"></tn-button>
               <!-- <tn-button shape="icon" class="tn-icon-delete" ndColor="#ff0000"
                  style="position: absolute;left: 75%;" size="lg" @click="deleteClick(item,index)"></tn-button> -->
               <view class="flex flex-direction">
               <view v-if="type!='2'" class="flex flex-direction">
                  <view style="font-size: 18px;">{{item.name}}</view>
                  <view style="margin-top: 5px;display: flex;">
                     <text
                        style="font-size: 12px;border-radius: 4px; background-color: rgba(255, 98, 98, 0.5);padding: 5px;color: #ff0000;">{{item.fencetype==0?'变电作业' : '输电作业'}}</text>
                        <view
                           style="margin-left: 95px; font-size: 12px;border-radius: 4px; background-color: rgba(0, 170, 255, 0.5);padding: 5px;" @click="positionclick(item.points)">定位</view>
                     <view
                        style="margin-left: 95px; font-size: 12px;border-radius: 4px; background-color: rgba(0, 170, 255, 0.5);padding: 5px;"
                        @click="positionclick(item.points)">定位</view>
                  </view>
                  <view style="display: flex;margin-top: 10px;">
@@ -35,7 +64,7 @@
                     </view>
                     <view style=" color: rgba(89, 89, 89); margin-left: 20px; font-size: 12px;">
                        围栏高度:{{item.height!=null?item.height:'无'}}</view>
                        围栏高度:{{item.height!=null?item.height:'无'}}m</view>
                     <!-- <view style="margin-left: 10px; background-color: rgba(255, 181, 166, 1.0); " >{{item.type}}</view> -->
                  </view>
                  <view
@@ -43,7 +72,8 @@
                     <!-- <h5 ></h5> -->
                     <view style=" word-wrap: break-word;padding: 10px;">
                        <h5>围栏坐标:{{ item.points.length > 35? item.points.slice(0, 35) + '...' : item.points }}</h5>
                        <h5>围栏坐标:{{ item.points.length > 35? item.points.slice(0, 35) + '...' : item.points }}
                        </h5>
                     </view>
                     <view style="display: flex;padding: 10px;">
@@ -52,8 +82,8 @@
                     </view>
                     <view style="display: flex;padding: 10px;">
                        <h5>预警距离:{{item.distance}}</h5>
                        <h5 style="margin-left: 20px;">地面海拔:{{item.baoliu4}}</h5>
                        <h5>预警距离:{{item.distance}}m</h5>
                        <h5 style="margin-left: 20px;">地面海拔:{{item.baoliu4}}m</h5>
                     </view>
                     <view style="padding: 10px;">
@@ -62,82 +92,218 @@
                  </view>
                  <view style="display: flex;margin-top: 10px;font-size: 17px;">
                     <view style="font-size: 17px;">
                        是否启用:<tn-switch v-model="item.isplay==1 ? true : false" style=""
                           @change="isopen(item, $event)" :size="num"></tn-switch>
                     </view>
                     <view style="position: absolute;right: 10%;font-size: 17px;">
                        是否显示:<tn-switch v-model="item.ishide==0 ? true : false" style=""
                           @change="isopenhide(item, $event)" :size="num"></tn-switch>
                     </view>
                  </view>
               </view>
               <view v-else class="flex flex-direction">
                  <view style="font-size: 18px;">{{item.cranename}}</view>
                  <view style="margin-top: 5px;display: flex;">
                     <text
                        style="font-size: 12px;border-radius: 4px; background-color: rgba(255, 98, 98, 0.5);padding: 5px;color: #ff0000;">吊臂防护</text>
                     <!-- <view
                        style="margin-left: 95px; font-size: 12px;border-radius: 4px; background-color: rgba(0, 170, 255, 0.5);padding: 5px;"
                        @click="positionclick(item.points)">定位</view> -->
                  </view>
                  <view style="display: flex;margin-top: 10px;">
                     <view style="font-size: 12px; color: rgba(89, 89, 89);">添加人:{{item.addperson}}</view>
                     <!-- <view style=" color: rgba(89, 89, 89); margin-left: 20px; font-size: 12px;">|
                     </view>
                     <view style=" color: rgba(89, 89, 89); margin-left: 20px; font-size: 12px;">
                        围栏高度:{{item.height!=null?item.height:'无'}}m</view> -->
                     <!-- <view style="margin-left: 10px; background-color: rgba(255, 181, 166, 1.0); " >{{item.type}}</view> -->
                  </view>
                  <view
                     style=" border-radius: 5px; background-color: rgba(197, 197, 197, 0.5);width: 100%;margin-top: 10px;">
                     <!-- <h5 ></h5> -->
                     <!--    <view style=" word-wrap: break-word;padding: 10px;">
                        <h5>围栏坐标:{{ item.points.length > 35? item.points.slice(0, 35) + '...' : item.points }}
                        </h5>
                     </view> -->
                     <view style="display: flex;padding: 10px;">
                        <h5>原点设备:{{item.deviceA}}</h5>
                        <h5 style="margin-left: 20px;">吊臂顶设备:{{item.deviceB}}</h5>
                     </view>
                     <view style="display: flex;padding: 10px;">
                        <h5>围栏角度:{{item.angle}}°</h5>
                        <h5 style="margin-left: 20px;">关联部门:{{item.bindfence}}</h5>
                     </view>
                     <view style="padding: 10px;">
                        <h5>时间:{{item.addtime}}</h5>
                     </view>
                  </view>
                  <view style="display: flex;margin-top: 10px;font-size: 17px;">
                     是否启用:<tn-switch v-model="item.isplay==1 ? true : false"
                        style="position: absolute;left: 85%;" @change="isopen(item, $event)"
                        :size="num"></tn-switch>
                  </view>
                  <view style="display: flex;margin-top: 10px;font-size: 17px;">
                     是否显示:<tn-switch v-model="item.ishide==0 ? true : false"
                        style="position: absolute;left: 85%;" @change="isopenhide(item, $event)"
                        :size="num"></tn-switch>
                  </view>
                  <!-- <view style="margin-top: 10px;font-size: 17px;">
                     <view style="font-size: 17px;">
                        是否启用:<tn-switch v-model="item.isplay==1 ? true : false" style=""
                           @change="isopen(item, $event)" :size="num"></tn-switch>
                     </view>
                  </view> -->
               </view>
            </view>
         </data-list>
      </view>
      <tn-popup v-model="showpopup" mode="bottom" closeBtn>
      <tn-popup v-model="showpopup" mode="bottom" closeBtn style="position: absolute;z-index: 9999999;">
         <view class="page-wrap u-skeleton">
            <view class="item-wrap">
               <tn-form>
                  <tn-form-item label="围栏名称:" :labelWidth="labelWidth">
                     <tn-input  v-model="form.name" inputAlign="right"></tn-input>
                  </tn-form-item>
                  <tn-form-item label="围栏性质:" :labelWidth="labelWidth">
                     <tn-input disabled v-model="form.fencetype" @click="show3 = true" inputAlign="right" />
                  </tn-form-item>
                  <tn-form-item label="围栏类型:" :labelWidth="labelWidth">
                     <tn-input v-model="form.type" type="select" @click="show1 = true" placeholder="请选择关联部门" />
                     <tn-action-sheet :list="typeList" v-model="show1" @click="typeCallback"></tn-action-sheet>
                  </tn-form-item>
                  <tn-form-item label="坐标:" :labelWidth="labelWidth">
                     <uni-tooltip :content="zuob" placement="bottom" >
                        <tn-input disabled v-model="form.points" inputAlign="right"></tn-input>
               <u-form>
                  <u-form-item label="围栏名称:" :labelWidth="labelWidth">
                     <u-input v-model="form.name" inputAlign="right"></u-input>
                  </u-form-item>
                  <u-form-item label="围栏性质:" :labelWidth="labelWidth">
                     <u-input disabled v-model="form.fencetype" @click="show3 = true" inputAlign="right" />
                  </u-form-item>
                  <u-form-item label="围栏类型:" :labelWidth="labelWidth" @click="show1 = true">
                     <!-- <u-input v-model="form.type" type="select"  placeholder="请选择关联部门" /> -->
                     <u-input v-model="form.type" disabled disabledColor="#ffffff" placeholder="请选择关联部门"
                        border="none" />
                     <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 label="坐标:" :labelWidth="labelWidth">
                     <uni-tooltip :content="zuob" placement="bottom">
                        <u-input disabled v-model="form.points" inputAlign="right"></u-input>
                     </uni-tooltip>
                  </tn-form-item>
                  <tn-form-item label="关联部门:" :labelWidth="labelWidth">
                  </u-form-item>
                  <u-form-item label="关联作业:" :labelWidth="labelWidth" @click="show2 = true">
                     <!-- <tn-input v-model="form.bumen" type="select" @click="show2 = true" inputAlign="right"
                        placeholder="请选择关联部门" /> -->
                     <!--    <uni-data-select placeholder="请选择关联部门" v-show="form.disable" v-model="form.department"
                        :localdata="bumenList" @change="bymenCallback"></uni-data-select> -->
                     <!-- <tn-action-sheet :disabled="form.disable" :list="bumenList" v-model="show2"
                        @click="bymenCallback"></tn-action-sheet> -->
                     <tn-input v-model="form.department" type="select" @click="show2 = true"
                        placeholder="请选择关联部门" />
                     <tn-action-sheet :list="bumenList" v-model="show2" @click="bymenCallback"></tn-action-sheet>
                  </tn-form-item>
                  <tn-form-item label="围栏高度:" :labelWidth="labelWidth">
                     <tn-input v-model="form.height" inputAlign="right" placeholder="请输入围栏高度"></tn-input>
                     <!--    <u-input v-model="form.department" type="select" @click="show2 = true"
                        placeholder="请选择关联作业" /> -->
                     <u-input v-model="form.department" disabled disabledColor="#ffffff" placeholder="请选择关联作业"
                        border="none" />
                     <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 label="围栏高度:" :labelWidth="labelWidth">
                     <u-input v-model="form.height" inputAlign="right" placeholder="请输入围栏高度"></u-input>
                     <text>m</text>
                  </tn-form-item>
                  <tn-form-item label="预警距离:" :labelWidth="labelWidth">
                     <tn-input v-model="form.distance" inputAlign="right" placeholder="请输入预警距离"></tn-input>
                  </u-form-item>
                  <u-form-item label="预警距离:" :labelWidth="labelWidth">
                     <u-input v-model="form.distance" inputAlign="right" placeholder="请输入预警距离"></u-input>
                     <text>m</text>
                  </tn-form-item>
                  <tn-form-item label="地面海拔:" :labelWidth="labelWidth">
                     <tn-input disabled v-model="form.baoliu4" inputAlign="right"></tn-input>
                  </u-form-item>
                  <u-form-item label="地面海拔:" :labelWidth="labelWidth">
                     <u-input disabled v-model="form.baoliu4" inputAlign="right"></u-input>
                     <text>m</text>
                  </tn-form-item>
                  <tn-form-item label="添加人:" :labelWidth="labelWidth">
                     <tn-input disabled v-model="form.addperson" inputAlign="right"></tn-input>
                  </tn-form-item>
                  <tn-form-item label="添加时间:" :labelWidth="labelWidth">
                     <tn-input disabled v-model="form.addtime" inputAlign="right"></tn-input>
                  </tn-form-item>
                  </u-form-item>
                  <u-form-item label="添加人:" :labelWidth="labelWidth">
                     <u-input disabled v-model="form.addperson" inputAlign="right"></u-input>
                  </u-form-item>
                  <u-form-item label="添加时间:" :labelWidth="labelWidth">
                     <u-input disabled v-model="form.addtime" inputAlign="right"></u-input>
                  </u-form-item>
               </tn-form>
               </u-form>
            </view>
            <button style="margin-top: 20px;" type="primary" @click="submitForm">保存围栏</button>
         </view>
      </tn-popup>
      <u-modal style="position: absolute;z-index: 99999999999999;" buttonReverse confirmText="保存" cancelText="取消"
         :show="showmodal" @cancel="cancelmodal" @confirm="submitmodal" ref="uModal" :showCancelButton="true"
         :closeOnClickOverlay="true">
         <!-- <tn-popup v-model="showpopup" mode="bottom" closeBtn>
         <view class="page-wrap u-skeleton"> -->
         <!-- <view class="item-wrap"> -->
         <!-- <view style="max-height: 300px; overflow-y: auto;"> -->
         <u--form style="" labelPosition="left" :model="fence" ref="uForm" :rules="rules2">
            <u-form-item required label="吊车名称:" prop="cranename" borderBottom ref="item1" labelWidth="80px">
               <u--input v-model="fence.cranename" border="none" placeholder="请输入吊车名称"></u--input>
            </u-form-item>
            <u-form-item required prop="deviceA" borderBottom label="原点设备:" labelWidth="80px"
               @click="showtagid1 = true">
               <!--    <u-badge v-if="tagonlie1==1 && fence.ydtag!=''" :isDot="true" type="success"></u-badge>
               <u-badge v-else-if="tagonlie1==0 && fence.ydtag!=''" :isDot="true" type="info"></u-badge> -->
               <!-- <u--input v-model="code" border="none" placeholder="请输入终端编号" @blur="seachcode"></u--input> -->
               <!-- <u-input v-model="fence.deviceA" type="select" @click="showtagid1 = true" placeholder="请选择原点设备" /> -->
               <u-input v-model="fence.deviceA" 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="showtagid1" mode="single" :list="tagidlist" @confirm="confirmtagid1"
                  :searchShow="true"></tn-select>
            </u-form-item>
            <u-form-item required prop="deviceB" borderBottom label="吊臂顶设备:" labelWidth="80px"
               @click="showtagid2 = true">
               <!--    <u-badge v-if="tagonlie2==1 && fence.dbtag!=''" :isDot="true" type="success"></u-badge>
               <u-badge v-else-if="tagonlie2==0 && fence.dbtag!=''" :isDot="true" type="info"></u-badge> -->
               <!-- <u--input v-model="code" border="none" placeholder="请输入终端编号" @blur="seachcode"></u--input> -->
               <!-- <u-input v-model="fence.deviceB" type="select" @click="showtagid2 = true" placeholder="请选择吊臂顶设备" /> -->
               <u-input v-model="fence.deviceB" 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="showtagid2" mode="single" :list="tagidlist" @confirm="confirmtagid2"
                  :searchShow="true"></tn-select>
            </u-form-item>
            <u-form-item required prop="bindfence" borderBottom label="关联作业:" labelWidth="80px"
               @click="show1 = true">
               <u-input v-model="fence.bindfence" 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="show1" mode="single" :list="bumenList" @confirm="bymenCallback2"
                  :searchShow="true"></tn-select>
            </u-form-item>
            <u-form-item required prop="angle" borderBottom label="围栏范围角度:" labelWidth="100px">
               <u--input v-model="fence.angle" border="none" placeholder="请输入围栏范围角度"></u--input>
               <!-- <u-switch v-model="isplay" @change="isopen"></u-switch> -->
            </u-form-item>
            <u-form-item label="是否启用:" :labelWidth="labelWidth">
               <!-- <u--input v-model="model.name" border="none" placeholder="请输入围栏名称"></u--input> -->
               <u-switch v-model="fence.isplay==1 ? true : false" @change="isopen1"></u-switch>
            </u-form-item>
         </u--form>
         <!-- </view> -->
         <!-- </view>
            <button style="margin-top: 20px;" type="primary" @click="submitForm">保存围栏</button> -->
      </u-modal>
      <tn-skeleton :show="showSkeleton"></tn-skeleton>
      <successCom ref="refSuccess"></successCom>
@@ -153,6 +319,11 @@
      minLogin
   } from '@/js/minLogin.js'
   import {
      craneKaiQi,
      craneGuanBi,
      findtagid,
      savecrane,
      findcranepage,
      updateFence,
      FenceKaiQihide,
      FenceGuanBihide,
@@ -174,6 +345,18 @@
      },
      data() {
         return {
            isplay: false,
            tagidlist: [],
            tagonlie1: '',
            tagonlie2: '',
            showtagid1: false,
            showtagid2: false,
            showmodal: false,
            type: '0',
            handovertype: '0',
            color: '#00aaff',
            decoration: 'underline',
            top: '20',
            labelWidth: 200,
            width: '90%',
            editindex: -1,
@@ -184,6 +367,57 @@
            zuobiaonum: 0,
            isshape: true,
            disable: true,
            rules2: {
               'cranename': {
                  type: 'string',
                  // max: 1,
                  required: true,
                  message: '请填写吊车名称',
                  trigger: ['blur', 'change']
               },
               'deviceA': {
                  type: 'string',
                  // max: 1,
                  required: true,
                  message: '请选择原点设备',
                  trigger: ['blur', 'change']
               },
               'deviceB': {
                  type: 'string',
                  // max: 1,
                  required: true,
                  message: '请选择吊臂顶设备',
                  trigger: ['blur', 'change']
               },
               'bindfence': {
                  type: 'string',
                  // max: 1,
                  required: true,
                  message: '请选择关联部门',
                  trigger: ['blur', 'change']
               },
               'angle': {
                  type: 'string',
                  // max: 1,
                  required: true,
                  message: '请填写围栏范围角度',
                  trigger: ['blur', 'change']
               },
            },
            fence: {
               cranename: '',
               deviceA: '',
               deviceB: '',
               isplay: '0',
               bindfence: '',
               angle: '10',
               addtime: '',
               company: this.company,
               addperson: this.username,
            },
            form: {
               name: '',
               fencetype: '',
@@ -205,17 +439,21 @@
            ],
            typeList: [{
                  text: '保护区'
                  value: '保护区',
                  label: '保护区'
               },
               {
                  text: '禁入区'
                  value: '禁入区',
                  label: '禁入区'
               },
               {
                  text: '工作区'
                  value: '工作区',
                  label: '工作区'
               },
               {
                  text: '安全区'
               }
                  value: '安全区',
                  label: '安全区'
               },
            ],
            bumen: '',
            bumenList: [],
@@ -250,7 +488,7 @@
               addperson: '',
               addtime: '',
            },
            num: 40,
            num: 30,
            isAchor: false,
            warnindex: 0,
            warlist: {},
@@ -279,7 +517,7 @@
            time: '',
            list: [],
            total: 0,
            zuob:[],
            zuob: [],
            options1: [{
               text: '删除',
               style: {
@@ -298,8 +536,8 @@
         }
      },
      mounted() {
         console.log(11111);
         this.findbumenall()
         this.findtagidall()
         this.topheight = this.vuex_custom_bar_height + 15
         setTimeout(() => {
            this.showSkeleton = false
@@ -313,11 +551,98 @@
      },
      methods: {
         positionclick(e){
            console.log(e);
            console.log(e.split(";")[0]);
            this.$emit('toposition',e.split(";")[0]);
            console.log(3333333333);
         isopen1(e) {
            if (e == true) {
               this.fence.isplay = '1'
            } else {
               this.fence.isplay = '0'
            }
         },
         confirmtagid1(e) {
            this.fence.deviceA = e[0].label
            // this.seachcode()
            this.tagonlie1 = e[0].value
         },
         confirmtagid2(e) {
            this.fence.deviceB = e[0].label
            // this.seachcode()
            this.tagonlie2 = e[0].value
         },
         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
                     });
                  }
               })
            }
         },
         cancelmodal() {
            this.showmodal = false
         },
         submitmodal() {
            this.fence.company = this.company
            this.fence.addperson = this.vuex_user
            this.$refs.uForm.validate().then(res => {
               uni.$u.toast('校验通过')
               console.log(this.fence);
               if (this.vuex_is_login) {
                  savecrane(this.fence).then((res) => {
                     console.log(res);
                     if (res.code == 0) {
                        this.handleRefresh({
                           page: 1,
                           size: this.pageSize
                        }, () => {
                           // 可以在这里处理加载完成后的逻辑
                        });
                        this.showmodal = false
                        this.fence.id = ''
                        this.fence.cranename = ''
                        this.fence.deviceA = ''
                        this.fence.deviceB = ''
                        this.fence.isplay = '0'
                        this.fence.bindfence = ''
                        this.fence.angle = '10'
                     } else {
                        this.$refs.refSuccess.showBox({
                           type: 'error',
                           txt: res.msg
                        });
                     }
                  })
               }
            })
         },
         goBack() {
            this.showmodal = true
            // this.disabled = false
            // this.form.personname = ''
            // this.form.encryption = ''
            // this.form.tagid = ''
            // this.form.department = ''
            // this.form.mestagid = ''
            // this.form.type = ''
            // this.form.bisuoid = ''
            // this.form.baoliu1 = ''
         },
         positionclick(e) {
            this.$emit('toposition', e.split(";")[0]);
         },
         manualRefresh() { //保存围栏成功刷新围栏列表页面
            this.isAchor = false
@@ -335,30 +660,46 @@
            });
         },
         isopen(item, e) {
            this.form.name = item.name
            if (item.isplay == 1) {
               item.isplay = 0
            } else {
               item.isplay = 1
               item.ishide = 0
            }
            const params = {
               name: item.name,
               // size: data.size,
            }
            // item.baoliu7 = e ? 1 : 0; // 根据开关状态更新
            if (this.vuex_is_login) {
               if (e == true) {
                  FenceGuanBi(params).then((res) => {
                     console.log(res);
                  })
            if (this.type == '2') {
               const params = {
                  name: item.cranename,
                  // size: data.size,
               }
               // item.baoliu7 = e ? 1 : 0; // 根据开关状态更新
               if (this.vuex_is_login) {
                  if (e == true) {
                     craneGuanBi(params).then((res) => {})
                  } else {
                     craneKaiQi(params).then((res) => {})
                  }
               }
            } else {
               this.form.name = item.name
               if (item.isplay == 1) {
                  item.isplay = 0
               } else {
                  FenceKaiQi(params).then((res) => {})
                  item.isplay = 1
                  item.ishide = 0
               }
               const params = {
                  name: item.name,
                  // size: data.size,
               }
               // item.baoliu7 = e ? 1 : 0; // 根据开关状态更新
               if (this.vuex_is_login) {
                  if (e == true) {
                     FenceGuanBi(params).then((res) => {})
                  } else {
                     FenceKaiQi(params).then((res) => {})
                  }
               }
            }
         },
         isopenhide(item, e) {
            this.form.name = item.name
            if (item.ishide == 1) {
@@ -373,17 +714,15 @@
            // item.baoliu7 = e ? 1 : 0; // 根据开关状态更新
            if (this.vuex_is_login) {
               if (e == true) {
                  FenceGuanBihide(params).then((res) => {
                     console.log(res);
                  })
                  FenceGuanBihide(params).then((res) => {})
               } else {
                  FenceKaiQihide(params).then((res) => {})
               }
            }
         },
         submitForm() {
            // this.form.list = this.list
            if (this.form.type == '') {
@@ -445,25 +784,28 @@
               this.isshape = false
            }
         },
         bymenCallback2(e) {
            this.fence.bindfence = e[0].label
         bymenCallback(index) {
            this.form.department = this.bumenList[index].text;
         },
         typeCallback(index) {
            this.form.type = this.typeList[index].text;
         bymenCallback(e) {
            this.form.department = e[0].label
         },
         typeCallback(e) {
            this.form.type = e[0].label;
         },
         findbumenall() {
            if (this.vuex_is_login) {
               const params = {
                  company: this.company,
                  juese:uni.getStorageSync('juese'),
                  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
                     }));
                     // }
                     // this.form.lonlat=res.data.lat+";"+res.data.lon
@@ -498,26 +840,76 @@
            this.show = false;
         },
         editClick(e, i) {
            this.editindex = i
            this.showpopup = true
            this.formfence.name = e.name
            this.formfence.fencetype = e.fencetype==0?'变电作业' : '输电作业'
            this.formfence.department = e.department
            this.formfence.points = e.points
            this.formfence.type = e.type
            this.formfence.height = e.height
            this.formfence.distance = e.distance
            this.formfence.baoliu4 = e.baoliu4
            // this.formfence.disable = e.disable
            this.formfence.addperson = e.addperson
            this.formfence.addtime = e.addtime
            this.form = this.formfence
            this.zuob = this.form.points.split(",")
            console.log(e);
            if (this.type == "2") {
               this.showmodal = true
               this.fence.id = e.id
               this.fence.cranename = e.cranename
               this.fence.deviceA = e.deviceA
               this.fence.deviceB = e.deviceB
               this.fence.isplay = e.isplay
               this.fence.bindfence = e.bindfence
               this.fence.angle = e.angle
               this.fence.company = e.company
               this.fence.addperson = e.addperson
               // this.fence.name = : {
               //    name: '',
               //    ydtag: '',
               //    dbtag: '',
               //    isplay: '0',
               //    department: '',
               //    angle: '10',
               //    addtime: '',
               //    company: this.company,
               //    addperson: this.username,
               // },
            } else {
               this.editindex = i
               this.showpopup = true
               this.formfence.name = e.name
               this.formfence.fencetype = e.fencetype == 0 ? '变电作业' : '输电作业'
               this.formfence.department = e.department
               this.formfence.points = e.points
               this.formfence.type = e.type
               this.formfence.height = e.height
               this.formfence.distance = e.distance
               this.formfence.baoliu4 = e.baoliu4
               // this.formfence.disable = e.disable
               this.formfence.addperson = e.addperson
               this.formfence.addtime = e.addtime
               this.form = this.formfence
               this.zuob = this.form.points.split(",")
            }
         },
         deleteClick(e, i) {
            this.deleindex = i
            this.delename = e.name
            this.show = true;
         },
         gotype(e) {
            uni.showLoading({
               title: '正在加载'
            });
            // if (e != "0") {
            //    this.color = ''
            //    this.decoration = ''
            // }
            this.handovertype = e
            console.log(this.type);
            this.handleRefresh({
               page: 1,
               size: this.pageSize
            }, () => {
               // 可以在这里处理加载完成后的逻辑
               uni.hideLoading();
               this.type = e
            });
         },
         goAchor() {
@@ -531,13 +923,16 @@
            this.lock = true
         },
         // 模拟请求加载数据
         handleLoad(data, callback) {
         handoverData(data, callback) {
            console.log(11111);
            const params = {
               type: this.handovertype,
               current: data.page,
               size: data.size,
               company: this.company,
                  juese:uni.getStorageSync('juese'),
               juese: uni.getStorageSync('juese'),
            }
            if (this.vuex_is_login) {
               findFence(params).then((res) => {
@@ -547,6 +942,47 @@
                        let list = [];
                        for (var i = 0; i < res.data.records.length; i++) {
                           list.push(res.data.records[i]);
                        }
                        // if (data.lock == true) {
                        //    this.list = []
                        // }
                        this.list = [...this.list, ...list];
                        callback({
                           // type:this.type,
                           list: this.list,
                           total: res.data.total
                        });
                     }, 1500);
                  }
               })
            } else {
               callback({
                  list: [],
                  total: 0
               });
            }
         },
         // 模拟请求加载数据
         handleLoad(data, callback) {
            const params = {
               // type: this.handovertype,
               current: data.page,
               size: data.size,
               company: this.company,
               juese: uni.getStorageSync('juese'),
            }
            if (this.vuex_is_login) {
               findFence(params).then((res) => {
                  if (res.code == 0) {
                     let list = [];
                     setTimeout(() => {
                        let list = [];
                        for (var i = 0; i < res.data.records.length; i++) {
                           list.push(res.data.records[i]);
                        }
                        if (data.lock == true) {
                           this.list = []
                        }
                        this.list = [...this.list, ...list];
@@ -567,11 +1003,12 @@
         handleSearch(data, callback) {
            const params = {
               // type: this.handovertype,
               current: 1,
               size: 10,
               objectid: this.keyword,
               company: this.company,
                  juese:uni.getStorageSync('juese'),
               juese: uni.getStorageSync('juese'),
            }
            if (this.vuex_is_login) {
               findFence(params).then((res) => {
@@ -598,14 +1035,16 @@
         handleRefresh(data, callback) {
            const params = {
               // type: this.handovertype,
               current: data.page,
               size: data.size,
               objectid: data.objectid,
               company: this.company,
                  juese:uni.getStorageSync('juese'),
               juese: uni.getStorageSync('juese'),
            }
            if (this.vuex_is_login) {
               findFence(params).then((res) => {
                  console.log(res);
                  if (res.code == 0) {
                     let list = [];
                     setTimeout(() => {
@@ -615,6 +1054,7 @@
                        }
                        this.list = []
                        this.list = [...this.list, ...list];
                        console.log(res.data.total);
                        callback({
                           list: this.list,
                           total: res.data.total
@@ -629,6 +1069,15 @@
</script>
<style lang="scss" scoped>
   .type {
      margin-top: 100px;
      position: absolute;
      z-index: 9999999999999;
      margin-left: 10%;
      font-size: 17px;
      font-weight: bold;
   }
   /* 鼠标未悬浮时效果设置 */
   .title_linespan {
      font-size: 17px;