派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-31 38bcd6306f20787e394347a34e50fcf80b265fc6
src/components/panel/topicSearch/enterprise-emergency/ResourcesQuery.vue
@@ -34,6 +34,12 @@
                    </el-option>
                </el-select>
            </el-form-item>
            <div class="page_total">
                <p>共计
                    <span>{{total}}</span>
                    条记录
                </p>
            </div>
            <div class="rightButtonSearch">
                <el-input v-model="form.keyword" size="mini" placeholder="在此输入关键字搜索"></el-input>
                <el-button class="el-icon-search" @click="handleSearch"></el-button>
@@ -51,6 +57,17 @@
                <p v-else>地址:<span>{{item.properties.adminzonename}}</span></p>
            </div>
        </el-scrollbar>
        <el-card class="footer-page" v-if="total > 10">
            <el-pagination
                    small
                    @current-change="handlePage"
                    :page-size=pageSize
                    layout="prev, pager, next"
                    :total=total
                    class="warnPagination"
            >
            </el-pagination>
        </el-card>
    </div>
</template>
@@ -84,6 +101,10 @@
      activeNum: -1,
      // 搜索到的数据进行存储的list
      list: [],
      // 搜索到的数据数量
      total: 0,
      // 分页
      pageSize: 10,
      // form表单绑定的图层数据
      items: [LayerEmergencySource, LayerSurroundings],
      subItems: LayerEmergencySource.layers || LayerSurroundings.layers,
@@ -97,6 +118,11 @@
    this.wfsHelper = new WfsHelper()
  },
  methods: {
    // 页面切换 分页功能
    handlePage (page) {
      // this.wfsHelper.setPage(page)
      this.handleSearch()
    },
    // 搜索展示图片根据返回值展示
    getImgSrc (type) {
      // console.log(type)
@@ -107,6 +133,7 @@
    handlePipelineType (val) {
      // console.log(val)
      this.list = []
      this.total = 0
      for (let i = 0; i < this.items.length; i++) {
        const item = this.items[i].name
        if (val === item.name) {
@@ -126,10 +153,12 @@
    handleDataType (val) {
      // console.log(val)
      this.list = []
      this.total = 0
    },
    // 点击搜索事件
    async handleSearch () {
      this.list = []
      this.total = 0
      this.wfsHelper.clearFilter()
      this.wfsHelper.setTypeName(['sewer:view_emergency'])
      this.wfsHelper.setMaxFeatures(100)
@@ -143,9 +172,10 @@
        this.wfsHelper.addLike('name', this.form.keyword)
      }
      const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
      // console.log(res)
      console.log(res)
      if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
        this.list = res.features
        this.total = res.numberReturned
      }
    },
    // 查询定位功能