派生自 wuyushui/SewerAndRainNetwork

ChenZeping
2021-04-29 c56e506fd34c58209240e97fc29043639fae5d19
src/components/panel/topicSearch/SolidWasteSearch.vue
@@ -15,11 +15,11 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-radio-group v-model="form.type" class="levelOfRisk">
          <el-radio v-for="(item,index) in levelOfRisk" :label="item.value" :key="index"><span class="levelOfRisk-type">{{item.name }}</span>
        <el-radio-group v-model="form.transferData" class="levelOfRisk">
          <el-radio v-for="(item,index) in levelOfRisk" :label="item.value" :key="index">
            <span class="levelOfRisk-type">{{ item.name }}</span>
          </el-radio>
        </el-radio-group>
        <div class="rightButtonSearch">
          <el-input v-model="form.keyword" size="mini" placeholder="在此输入关键字搜索"></el-input>
          <el-button class="el-icon-search" @click="handleSearch"></el-button>
@@ -29,7 +29,8 @@
    <el-scrollbar style="height:286.22px">
      <div class="environmental-risk-list" v-for="(item,index) in searchDataDisplay" :key="index"
           @click="setBounced(item)">
        <i class="state"></i>
        <!--        <i class="state"></i>-->
        <img src="../../../../public/assets/images/map/solidwaste/gf_green2.png" alt="" class="state">
        <div>
          <h3>###炼化部</h3>
          <p>所属部门:<span>{{ item.Name }}</span></p>
@@ -43,27 +44,41 @@
<script>
import mapApi from '@/api/mapApi'
import WasteSolidIndex from '@/components/BaseNav/WasteSolid/WasteSolidIndex'
export default {
  name: 'SolidWasteSearch',
  props: ['title'],
  data () {
    return {
      judgeVisible: true,
      form: {
        keyword: '固废面板数据查询',
        // 数据的传递
        transferData: 1
      },
      levelOfRisk: [
        {
          name: '全部',
          value: '1'
          value: 1
        },
        {
          name: '正常',
          value: '2'
          value: 2
        },
        {
          name: '预警',
          value: '3'
          value: 3
        }
      ],
      judgeVisible: true,
      // 数据搜索之后,存储数据的
      searchDataDisplay: [],
      instance: null,
      intervals: [],
      layer: window.map,
      L: window.L,
      times: 5,
      colors: ['#98FB98', '#ff0000'],
      solidWasteTypeOptions: [{
        value: '1',
        label: '区域',
@@ -128,25 +143,11 @@
          label: '长度(m)',
          key: 'length'
        }]
      }],
      radio: '1',
      form: {
        keyword: '固废面板数据查询',
        // 数据的传递
        transferData: ''
      },
      // 数据搜索之后,存储数据的
      searchDataDisplay: []
      }]
    }
  },
  methods: {
    setBounced (item) {
      console.log(item)
      const bound = this.L.geoJSON([item], {}).getBounds()
      var layer = window.serviceLayerHelper.getByLayerId(item.StoragePlaceId)
      layer && layer.openPopup()
      this.$store.state.map.flyToBounds(bound)
    },
    // select的option的数据选择
    handlePipelineType (val) {
      this.solidWasteTypeOptions.forEach(item => {
        if (val === item.value) {
@@ -158,8 +159,23 @@
    async handleSearch (data) {
      // console.log(this.form.keyword)
      const result = await mapApi.getSolidWaste(data)
      console.log(result)
      this.searchDataDisplay = result.Result.DataInfo
    },
    // 数据展示,点击进行弹框及点的展示
    setBounced (val) {
      console.log(val)
      const pos = [val.Latitude, val.Longitude]
      window.map.flyTo(pos, 15)
      window.$layer.open({
        content: {
          content: WasteSolidIndex, // 组件
          parent: this, // 父组件
          data: { // 传递的参数
            storagePlaceId: val.StoragePlaceId
          }
        },
        title: val.Name
      })
    }
  }
}