派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-30 8d755b0755dac542cc092ab8e40e65ba8d664bc6
企业应急-事件上报-定位优化
3个文件已修改
147 ■■■■■ 已修改文件
src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue
@@ -1,38 +1,52 @@
<template>
    <div class="location-lon-and-lat">
        <el-row class="place-box">
            <div class="place-left">
                <el-form :model="LongLatPos" label-width="90px">
                    <el-row style="display: flex;align-items: center">
                        <el-form-item label="经度:" style="display: inline-block">
                            <el-col :span="20">
                                <el-input v-model="LongLatPos.longPos"></el-input>
                            </el-col>
                        </el-form-item>
                        <el-col :span="4">
                            <el-button type="primary" size="small" @click="mapPoints">点击定位</el-button>
                        </el-col>
                    </el-row>
                    <el-row style="display: flex;align-items: center">
                        <el-form-item label="纬度:">
                            <el-col :span="20">
                                <el-input v-model="LongLatPos.latPos"></el-input>
                            </el-col>
                        </el-form-item>
                        <el-col :span="4">
                            <el-button type="primary" size="small" @click="dataPoints">数据定位</el-button>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
            <!--            <div class="place-right">-->
            <!--                <el-button type="primary" size="small" @click="mapPoints">点击定位</el-button>-->
            <!--                <el-button type="primary" size="small" @click="dataPoints">数据定位</el-button>-->
            <!--            </div>-->
        <!--        <el-row>-->
        <!--            <el-form :model="lonlatpos" label-width="60px">-->
        <!--                <el-col :span="12">-->
        <!--                    <el-form-item label="经度:">-->
        <!--                        <el-input type="text" v-model="lonlatpos.longPos"></el-input>-->
        <!--                    </el-form-item>-->
        <!--                </el-col>-->
        <!--                <el-col :span="12">-->
        <!--                    <el-form-item label="纬度:">-->
        <!--                        <el-input type="text" v-model="lonlatpos.latPos"></el-input>-->
        <!--                    </el-form-item>-->
        <!--                </el-col>-->
        <!--            </el-form>-->
        <!--            <el-row>-->
        <!--                <el-col :span="12" style="text-align: center;margin: 5px 0">-->
        <!--                    <el-button type="primary" size="small" @click="mapPoints">精确定位</el-button>-->
        <!--                </el-col>-->
        <!--                <el-col :span="12" style="text-align: center;margin: 5px 0">-->
        <!--                    <el-button type="primary" size="small" @click="dataPoints">数据识取</el-button>-->
        <!--                </el-col>-->
        <!--            </el-row>-->
        <!--        </el-row>-->
        <el-form :model="lonlatpos" label-width="60px">
            <el-row class="pipe-line-search">
                <el-col :span="12">
                    <el-form-item label="经度:">
                        <el-input v-model="lonlatpos.longPos"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="纬度:">
                        <el-input v-model="lonlatpos.latPos"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <el-row>
            <el-col :span="12" style="text-align: center;margin: 5px 0">
                <el-button type="primary" size="small" @click="mapPoints">精确定位</el-button>
            </el-col>
            <el-col :span="12" style="text-align: center;margin: 5px 0">
                <el-button type="primary" size="small" @click="dataPoints">数据识取</el-button>
            </el-col>
        </el-row>
        <div class="place-bottom" style="text-align: right;margin: 5px">
        <el-row class="place-bottom" style="text-align: right;margin: 5px">
            <el-button type="primary" @click="confirm" size="small">确认</el-button>
        </div>
        </el-row>
    </div>
</template>
@@ -46,7 +60,7 @@
  data () {
    return {
      // 经纬度定位
      LongLatPos: {
      lonlatpos: {
        longPos: '',
        latPos: ''
      },
@@ -54,20 +68,20 @@
    }
  },
  methods: {
    // 点击定位
    // 精确定位
    mapPoints () {
      window.map.on('click', (e) => {
        this.LongLatPos.longPos = parseFloat(e.latlng.lng).toFixed(6)
        this.LongLatPos.latPos = parseFloat(e.latlng.lat).toFixed(6)
        const as = [this.LongLatPos.latPos, this.LongLatPos.longPos]
        this.lonlatpos.longPos = parseFloat(e.latlng.lng).toFixed(8)
        this.lonlatpos.latPos = parseFloat(e.latlng.lat).toFixed(8)
        const as = [e.latlng.lat, e.latlng.lng]
        // console.log(as)
        window.map.setView(as, 17)
        pulseEffect(as)
        this.marker = window.L.marker(as, {
          icon: window.L.icon({
            iconUrl: iconUrl,
            iconSize: [25, 45],
            iconAnchor: [15, 15]
            iconSize: [26, 40],
            iconAnchor: [13, 20]
          })
        })
        window.map.addLayer(this.marker)
@@ -76,28 +90,31 @@
    },
    // 通过数据定位
    dataPoints () {
      const as = [this.LongLatPos.latPos, this.LongLatPos.longPos]
      // console.log(as)
      window.map.setView(as, 17)
      pulseEffect(as)
      this.marker = window.L.marker(as, {
        icon: window.L.icon({
          iconUrl: iconUrl,
          iconSize: [30, 30],
          iconAnchor: [15, 15]
      // this.lonlatpos.latPos = ''
      // this.lonlatpos.longPos = ''
      if (this.lonlatpos.latPos !== '' && this.lonlatpos.longPos !== '') {
        const as = [this.lonlatpos.latPos, this.lonlatpos.longPos]
        window.map.setView(as, 17)
        pulseEffect(as)
        this.marker = window.L.marker(as, {
          icon: window.L.icon({
            iconUrl: iconUrl,
            iconSize: [30, 40],
            iconAnchor: [15, 20]
          })
        })
      })
      window.map.addLayer(this.marker)
      this.LongLatPos.latPos = ''
      this.LongLatPos.longPos = ''
        window.map.addLayer(this.marker)
      } else {
        this.$message('请输入识取经纬度')
      }
    },
    // 点击确认按钮事件
    confirm () {
      window.mapManager.clearHighlight()
      window.map.removeLayer(this.marker)
      eventBus.$emit('location-setChange', true)
      this.LongLatPos.longPos = ''
      this.LongLatPos.latPos = ''
      this.lonlatpos.longPos = ''
      this.lonlatpos.latPos = ''
    }
  }
}
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue
@@ -1,7 +1,11 @@
<template>
    <div class="click-location">
        <el-row>
            <el-input type="text" v-model="clickLocation" clearable @change="focusLocation"></el-input>
            <el-input type="text" v-model="clickLocation" @change="focusLocation">
                <el-button slot="suffix" type="text" @click="focusLocation">
                    <img src="../../../../../public/assets/images/map/emergency/search.png" alt="">
                </el-button>
            </el-input>
        </el-row>
        <!--        <el-scrollbar style="height:250.34px">-->
        <el-row v-for="(item,index) in searchList.slice((currentPage-1)*pageSize,currentPage*pageSize)" :key="index"
@@ -92,6 +96,7 @@
        },
        type: 'query'
      }
      // $http.get('http://10.246.133.164//api/search?', data)
      reportLocationSearch(data).then(res => {
        console.log(res)
        this.searchList = res.pois
@@ -176,10 +181,6 @@
        .el-input {
            width: 80%;
            margin: 15px auto;
        }
        .el-button {
            margin: 15px auto;
        }
    }
src/components/base-page/enterprise-emergency/events-reported/ReportLocationSection.vue
@@ -2,16 +2,16 @@
    <div class="ReportLocationSection">
        <el-form :model="form" label-width="120px">
            <el-row class="pipe-line-search">
                <el-col :span="12">
                <el-col :span="18">
                    <el-form-item label="管线名称:">
                        <el-input v-model="form.pipeName">
                        <el-input v-model="form.pipeName" @change="pipelineSearch">
                            <el-button style="padding-right:10px;" slot="suffix" type="text" @click="pipelineSearch">
                                <img src="../../../../../public/assets/images/map/emergency/search.png" alt="">
                            </el-button>
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                <el-col :span="6">
                    <el-button type="primary" size="small" icon="el-icon-location-outline" @click="pipeClickLocation">定位
                    </el-button>
                </el-col>
@@ -25,12 +25,12 @@
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="附属设施名称:">
                    <el-form-item label="附属设施编码:">
                        <el-input v-model="form.affiliatedFacilities" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="附属设施编码:">
                    <el-form-item label="附属设施类型:">
                        <el-input v-model="form.affiliatedFacilitiesCode" disabled></el-input>
                    </el-form-item>
                </el-col>
@@ -268,8 +268,9 @@
    // 点击附属设施列表 管段编码传递
    affFacName (val) {
      console.log(val)
      // this.form.affiliatedFacilities = val.properties.code
      this.form.affiliatedFacilities = val.properties.name
      this.form.affiliatedFacilitiesCode = val.properties.code
      this.form.affiliatedFacilitiesCode = val.properties.type
    },
    // 定位功能
    localAdr (val) {