派生自 wuyushui/SewerAndRainNetwork

wangqi
2021-04-02 c3b1af220f56a85491badc2b11ed2c89fee14622
src/components/panel/topicSearch/SolidWasteSearch.vue
@@ -27,43 +27,16 @@
          <i slot="suffix" class="search-btn el-input__icon el-icon-search" @click="handleSearch"></i>
        </el-input>
      </el-form>
      <div>
        <el-card class="box-card" v-for="(item,index) in searchDataDisplay" :key="index">
          <div v-if="total > 3">
            {{ item.CompanyName }}
          </div>
        </el-card>
        <el-pagination
            small
            layout="prev, pager, next"
            :total=total
            :current-page=1
            class="warnPagination"
        >
        </el-pagination>
      </div>
      <!--      <el-scrollbar style="height:100%">-->
      <!--      <el-card class="footer-page">-->
      <!--        <ul>-->
      <!--          {{ searchDataDisplay }}-->
      <!--          <li v-for="(item,index) in searchDataDisplay" :key="index">-->
      <!--            {{ item.CompanyName }}-->
      <!--          </li>-->
      <!--        </ul>-->
      <!--      </el-card>-->
      <!--          <el-pagination-->
      <!--              small-->
      <!--              @current-change="handlePage"-->
      <!--              :page-size=pageSize-->
      <!--              layout="prev, pager, next"-->
      <!--              :total=total-->
      <!--              :current-page=current-->
      <!--              class="warnPagination"-->
      <!--          >-->
      <!--          </el-pagination>-->
      <!--      </el-card>-->
      <!--      </el-scrollbar>-->
      <el-card class="box-card"
               v-for="(item,index) in searchDataDisplay"
               :key="index">
        <div>
          {{ item.CompanyName }}
        </div>
      </el-card>
    </div>
    <!--      <el-scrollbar style="height:100%">-->
    <!--      </el-scrollbar>-->
  </div>
</template>
@@ -144,38 +117,32 @@
      }],
      radio: '1',
      form: {
        keyword: '固废面板数据查询'
        keyword: '固废面板数据查询',
        // 数据的传递
        transferData: ''
      },
      searchDataDisplay: [],
      total: 0
      searchDataDisplay: []
    }
  },
  methods: {
    handlePipelineType (val) {
      this.solidWasteTypeOptions.forEach((itm) => {
        if (val === itm.value) {
          this.dataTypeOptions = itm.options
          this.form.pipelineType = itm.label
          this.form.labelList = itm.labelList
      // console.log(val)
      this.solidWasteTypeOptions.forEach(item => {
        // console.log(item.value)
        if (val === item.value) {
          // console.log('数据选择相同')
          // 接收数据 用于之后接口数据的调用
          // this.form.transferData = item.value
          this.handleSearch(item.value)
        }
      })
      this.form.dataType = this.dataTypeOptions[0].label
      this.form.key = this.dataTypeOptions[0].key
    },
    // 点击搜索实现数据的搜索展示
    async handleSearch () {
    async handleSearch (data) {
      // console.log(this.form.keyword)
      const result = await mapApi.getSolidWasteSurveyDetail()
      console.log(result)
      const result = await mapApi.getSolidWasteSurveyDetail(data)
      // console.log(result)
      this.searchDataDisplay = result.Result.DataInfo
      this.total = result.Result.DataInfo.length
    },
    handleLocation (val) {
      // console.log(val)
      const bound = this.L.geoJSON([val], {}).getBounds()
      var layer = window.serviceLayerHelper.getByLayerId(val.id)
      layer && layer.openPopup()
      this.$store.state.map.map.flyToBounds(bound)
    }
  }
}