派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-14 4907618343198c0c772fce47e1a4a44500637c1f
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>
@@ -49,20 +49,6 @@
  props: ['title'],
  data () {
    return {
      levelOfRisk: [
        {
          name: '全部',
          value: '1'
        },
        {
          name: '正常',
          value: '2'
        },
        {
          name: '预警',
          value: '3'
        }
      ],
      judgeVisible: true,
      solidWasteTypeOptions: [{
        value: '1',
@@ -129,37 +115,49 @@
          key: 'length'
        }]
      }],
      radio: '1',
      form: {
        keyword: '固废面板数据查询',
        // 数据的传递
        transferData: ''
        transferData: 1
      },
      levelOfRisk: [
        {
          name: '全部',
          value: 1
        },
        {
          name: '正常',
          value: 2
        },
        {
          name: '预警',
          value: 3
        }
      ],
      // 数据搜索之后,存储数据的
      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)
    },
    handlePipelineType (val) {
      this.solidWasteTypeOptions.forEach(item => {
        if (val === item.value) {
          this.handleSearch(item.value)
        }
      })
    },
    // 点击搜索实现数据的搜索展示
    async handleSearch (data) {
      // console.log(this.form.keyword)
      const result = await mapApi.getSolidWaste(data)
      console.log(result)
      this.searchDataDisplay = result.Result.DataInfo
    },
    // 数据展示,点击进行弹框及点的展示
    setBounced (val) {
      const pos = [val.Latitude, val.Longitude]
      window.map.flyTo(pos, 11)
    },
    // select的option的数据选择
    handlePipelineType (val) {
      this.solidWasteTypeOptions.forEach(item => {
        if (val === item.value) {
          this.handleSearch(item.value)
        }
      })
    }
  }
}