From 15121491b97a4c8bf41fd9f8a678c5cd825ffe64 Mon Sep 17 00:00:00 2001 From: wangqi <magical1908@outlook.com> Date: 星期四, 01 四月 2021 17:49:07 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/panel/topicSearch/SolidWasteSearch.vue | 106 +++++++++++++++++++++++++++-------------------------- 1 files changed, 54 insertions(+), 52 deletions(-) diff --git a/src/components/panel/topicSearch/SolidWasteSearch.vue b/src/components/panel/topicSearch/SolidWasteSearch.vue index c672fb9..87b3911 100644 --- a/src/components/panel/topicSearch/SolidWasteSearch.vue +++ b/src/components/panel/topicSearch/SolidWasteSearch.vue @@ -27,43 +27,28 @@ <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-card class="box-card" + v-for="(item,index) in searchDataDisplay.slice((currentPage-1)*PageSize,currentPage*PageSize)" + :key="index"> + <div v-if="totalCount > 0"> + {{ item.CompanyName }} + </div> + </el-card> + <div class="search-pagination"> <el-pagination small - layout="prev, pager, next" - :total=total - :current-page=1 - class="warnPagination" - > + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page="currentPage" + :page-sizes="[1, 2, 3]" + :page-size="1" + layout="total, sizes, prev, pager, next, jumper" + :total='totalCount'> </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>--> </div> + <!-- <el-scrollbar style="height:100%">--> + <!-- </el-scrollbar>--> </div> </template> @@ -144,38 +129,50 @@ }], radio: '1', form: { - keyword: '鍥哄簾闈㈡澘鏁版嵁鏌ヨ' + keyword: '鍥哄簾闈㈡澘鏁版嵁鏌ヨ', + // 鏁版嵁鐨勪紶閫� + transferData: '' }, searchDataDisplay: [], - total: 0 + // 榛樿鏄剧ず绗嚑椤� + currentPage: 1, + // 鎬绘潯鏁帮紝鏍规嵁鎺ュ彛鑾峰彇鏁版嵁闀垮害(娉ㄦ剰锛氳繖閲屼笉鑳戒负绌�) + totalCount: 1, + // 涓暟閫夋嫨鍣紙鍙慨鏀癸級 + pageSizes: [1, 2, 3, 4], + // 榛樿姣忛〉鏄剧ず鐨勬潯鏁帮紙鍙慨鏀癸級 + PageSize: 1 } }, methods: { + // 姣忛〉鏄剧ず鐨勬潯鏁� + handleSizeChange (val) { + this.PageSize = val + this.currentPage = 1 + }, + // 鏄剧ず绗嚑椤� + handleCurrentChange (val) { + this.currentPage = val + }, 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) + this.totalCount = result.Result.DataInfo.length } } } @@ -228,5 +225,10 @@ .box-card { margin: 15px auto; } + + .search-pagination { + padding: 0; + margin: 15px auto; + } } </style> -- Gitblit v1.8.0