From 447610041c067c090497108c49f923b4ae5ea76e Mon Sep 17 00:00:00 2001 From: chenzeping <ChenZeping02609@163.com> Date: 星期三, 14 四月 2021 09:57:02 +0800 Subject: [PATCH] 固废查询 --- src/components/panel/topicSearch/SolidWasteSearch.vue | 183 ++++++++++++++++----------------------------- 1 files changed, 66 insertions(+), 117 deletions(-) diff --git a/src/components/panel/topicSearch/SolidWasteSearch.vue b/src/components/panel/topicSearch/SolidWasteSearch.vue index c672fb9..8649d6b 100644 --- a/src/components/panel/topicSearch/SolidWasteSearch.vue +++ b/src/components/panel/topicSearch/SolidWasteSearch.vue @@ -1,9 +1,6 @@ <template> - <div class="solidwaste-search" v-if="judgeVisible"> - <div class="search-title"> - <span>鍥哄簾</span> - <!-- <span>{{ title }}</span>--> - </div> + <div class="sewers-search" v-if="judgeVisible"> + <div class="panel-title">{{ title }}</div> <div class="search-panel "> <el-form ref="form" :model="form" label-width="90px" class="search-form"> <el-form-item v-for="(item,index) in solidWasteTypeOptions" :key="index" :label="item.label+'锛�'" size="mini" @@ -18,64 +15,57 @@ </el-option> </el-select> </el-form-item> - <div class="search-radio"> - <el-radio v-model="radio" label="1">鍏ㄩ儴</el-radio> - <el-radio v-model="radio" label="2">姝e父</el-radio> - <el-radio v-model="radio" label="3">棰勮</el-radio> + <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> + </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> </div> - <el-input v-model="form.keyword" size="mini" placeholder="鍦ㄦ杈撳叆鍏抽敭瀛楁悳绱�"> - <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>--> </div> + <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> + <div> + <h3>###鐐煎寲閮�</h3> + <p>鎵�灞為儴闂細<span>{{ item.Name }}</span></p> + <p>椋庨櫓绾у埆锛�<span>涓夌骇</span></p> + </div> + </div> + </el-scrollbar> </div> </template> <script> import mapApi from '@/api/mapApi' +import WfsHelper from '@components/helpers/WfsHelper' export default { name: 'SolidWasteSearch', props: ['title'], data () { return { + levelOfRisk: [ + { + name: '鍏ㄩ儴', + value: '1' + }, + { + name: '姝e父', + value: '2' + }, + { + name: '棰勮', + value: '3' + } + ], judgeVisible: true, solidWasteTypeOptions: [{ value: '1', @@ -144,38 +134,43 @@ }], radio: '1', form: { - keyword: '鍥哄簾闈㈡澘鏁版嵁鏌ヨ' + keyword: '鍥哄簾闈㈡澘鏁版嵁鏌ヨ', + // 鏁版嵁鐨勪紶閫� + transferData: '' }, - searchDataDisplay: [], - total: 0 + // 鏁版嵁鎼滅储涔嬪悗锛屽瓨鍌ㄦ暟鎹殑 + searchDataDisplay: [] } }, methods: { + setBounced (val) { + console.log(val) + const bound = this.L.geoJSON([val], {}).getBounds() + // var layer = window.layerFactory.flyByLayerId(val.id, bound) + window.map.flyToBounds(bound) + // layer && layer.openPopup() + }, handlePipelineType (val) { - this.solidWasteTypeOptions.forEach((itm) => { - if (val === itm.value) { - this.dataTypeOptions = itm.options - this.form.pipelineType = itm.label - this.form.labelList = itm.labelList + this.solidWasteTypeOptions.forEach(item => { + if (val === item.value) { + this.handleSearch(item.value) } }) - this.form.dataType = this.dataTypeOptions[0].label - this.form.key = this.dataTypeOptions[0].key }, // 鐐瑰嚮鎼滅储瀹炵幇鏁版嵁鐨勬悳绱㈠睍绀� - async handleSearch () { - // console.log(this.form.keyword) - const result = await mapApi.getSolidWasteSurveyDetail() - 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) + async handleSearch (data) { + // // console.log(this.form.keyword) + // const result = await mapApi.getSolidWaste(data) + // console.log(result) + // this.searchDataDisplay = result.Result.Result + var wfsHelper = new WfsHelper() + wfsHelper.addTypeName('鍥哄簾') + wfsHelper.addLike('name', this.form.keyword) + const res = await mapApi.getSolidWaste(wfsHelper.getUrl(), {}) + console.log(res) + // if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) { + this.searchDataDisplay = res.Result.Result + // } } } } @@ -183,50 +178,4 @@ <style lang="less" scoped> -.solidwaste-search { - position: relative; - overflow: hidden; - - .search-panel { - background-color: transparent; - border: 1px solid @background-color-split; - padding: 10px; - - /deep/ input { - border-radius: 0; - background-color: @background-color-split; - border: solid 1px @color; - color: @color-gray; - font-size: 0.01rem; - - .el-select .el-input.is-focus .el-input__inner { - border-color: @color; - } - } - - /deep/ input:focus { - border-color: @color; - } - } - - .search-btn { - - } - - .search-radio { - margin: 15px auto; - display: flex; - align-items: center; - justify-content: space-around; - } - - .location-btn:hover, .el-input__icon:hover { - color: @color; - cursor: pointer; - } - - .box-card { - margin: 15px auto; - } -} </style> -- Gitblit v1.8.0