From 34a0220d8f02151846783ba22fbca06e376edbf5 Mon Sep 17 00:00:00 2001 From: chenyabin <Chenab123!> Date: 星期一, 19 四月 2021 18:02:35 +0800 Subject: [PATCH] 完成附属设施功能。 --- src/components/panel/RightSearchPanel.vue | 5 src/conf/Topic.js | 4 src/components/BaseNav/pipeline/AffiliatedFacilities.vue | 200 +++++++++++++++++++++++++++++++++++---- src/assets/css/map/map-panel-style.less | 10 + src/components/panel/topicSearch/SewersSearch.vue | 62 ++++++++---- 5 files changed, 233 insertions(+), 48 deletions(-) diff --git a/src/assets/css/map/map-panel-style.less b/src/assets/css/map/map-panel-style.less index 7c2e6f6..751ab6a 100644 --- a/src/assets/css/map/map-panel-style.less +++ b/src/assets/css/map/map-panel-style.less @@ -8,10 +8,15 @@ /*鍏ㄥ眬璁剧疆***********/ -h1, h2, h3, h4, h5, h6, ul, li, p { +h1, h2, h3, h4, h5, h6, ul, li, p,i ,span,div{ padding: 0; margin: 0; list-style: none; + -moz-user-select:none; /*鐏嫄*/ + -webkit-user-select:none; /*webkit娴忚鍣�*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*鏃╂湡娴忚鍣�*/ + user-select:none; } .rt{ @@ -33,6 +38,9 @@ z-index: 2000; // left: 50%; //bottom:15px; + .el-dialog__header{ + border-bottom: 1px solid @background-color-split; + } } i { font-style: normal diff --git a/src/components/BaseNav/pipeline/AffiliatedFacilities.vue b/src/components/BaseNav/pipeline/AffiliatedFacilities.vue index 3cc7ce3..71806b6 100644 --- a/src/components/BaseNav/pipeline/AffiliatedFacilities.vue +++ b/src/components/BaseNav/pipeline/AffiliatedFacilities.vue @@ -3,42 +3,123 @@ <div class="affiliatedFacilities"> <el-dialog custom-class="affiliatedFacilities-dialog" - title="鎻愮ず" + :title="facilitiesParameter.properties.pipename" :visible.sync="dialogVisible" :append-to-body="true" :modal="false" v-dialogDrag > - <div> - <h3>闄勫睘璁炬柦鍒嗙被</h3> - <ul> - <li>闄勫睘璁炬柦瀛愮被</li> - <li>闄勫睘璁炬柦瀛愮被</li> - <li>闄勫睘璁炬柦瀛愮被</li> - <li>闄勫睘璁炬柦瀛愮被</li> - <li>闄勫睘璁炬柦瀛愮被</li> - </ul> + <div class="search-panel "> + <el-form ref="form" :model="form" label-width="90px" class="search-form"> + <!-- <el-form-item label="绠$嚎淇℃伅锛�" size="mini" class="search-panel-item"> + <div class="el-select el-select--mini">8888</div> + </el-form-item> --> + <el-form-item label="璁炬柦绫诲瀷锛�" size="mini" class="search-panel-item"> + <el-select style="width: 100%" v-model="form.dataType" @change="handleDataType" :popper-class="'select-down'"> + <el-option v-for="(item,index) in classification" :key="index" :label="item.name" :value="item"></el-option> + </el-select> + </el-form-item> + <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-form> </div> - + <el-scrollbar style="height:300px;"> + <div class="environmental-risk-list" v-for="(item,index) in list" :key="index" :class="activeNum==index?'hover':''"> + <img class="state" :src="getImgSrc()" style="background: none"/> + <div> + <h3 @click="handleLocation(item,index)">{{ item.properties.pipename }}</h3> + <p>鎵�灞炰紒涓氾細<span>{{ item.properties.orgcode }}</span> + <p>璁炬柦绫诲瀷锛�<span>{{ item.properties.teetype }}</span> + <!-- <el-button v-if="fuShuSheShiShow" class="rt" size="mini" style="margin-right: 0.04rem" @click="btnAffiliatedFacilities(item)" >闄勫睘璁炬柦</el-button> --> + </p> + </div> + </div> + </el-scrollbar> + <!-- <div v-for="(item,index) in classification" :key="index"> + <h3 @click="btnfuShuSheShiSubItems(item,index)"> <i :class="item.isShow?'icon iconfont iconcaret-right':'icon iconfont iconsort-down'"></i> {{item.name}}</h3> + <ul v-if="item.isShow"> + <li v-for="(item1,index1) in item.features" :key="index1" @click="btnFeatures(item,item1,index,index1)" :class="item.activeNum==index1?'hover':''" >{{item1.properties.pipename}}</li> + </ul> + </div> --> </el-dialog> </div> </template> <script> +import WfsHelper from '@components/helpers/WfsHelper' +import AjaxUtils from '@utils/AjaxUtils' +import { LayerFsss } from '@src/conf/layers/LayerFsss' + +console.log(LayerFsss, 8888888888) export default { name: 'AffiliatedFacilities', data () { return { - dialogVisible: true + dialogVisible: false, + form: { + areaVal: '', + keyword: '' + }, + classification: LayerFsss.layers, + list: [], + activeNum: -1 + } + }, + props: ['facilitiesParameter', 'fuShuSheShiSubItems'], + watch: { + facilitiesParameter: { + handler (newValue, oldValue) { + this.dialogVisible = true + this.list = [] + }, + deep: true } }, methods: { + getImgSrc () { + const icon = this.form.dataType.icon + return icon ? 'assets/images/map/' + icon : '' + }, handleClose (done) { - this.$confirm('纭鍏抽棴锛�') - .then(_ => { - done() - }) - .catch(_ => {}) + // this.$confirm('纭鍏抽棴锛�').then(_ => { done() }).catch(_ => {}) + }, + btnFeatures (val, val1, index, index1) { + this.classification.forEach((item) => { + item.activeNum = -1 + }) + this.classification[index].activeNum = index1 + this.$forceUpdate() + window.layerFactory.flyByFeature(val1, val.code) + }, + handleDataType () { + + }, + async handleSearch () { + var wfsHelper = new WfsHelper() + // todo 鐜板湪绠$綉杩樻病鍖哄垎寮�绫诲瀷锛屽悗闈㈡敼 + wfsHelper.addTypeName(this.form.dataType.sname) + wfsHelper.addLike('name', this.form.keyword) + // const _this = this + + const res = await AjaxUtils.GetDataAsynByUrl(wfsHelper.getUrl(), {}) + console.log(res) + + if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) { + const datas = res.features + const arrs = [] + for (let i = 0; i < 7; i++) { + arrs.push(datas[i]) + } + this.list = arrs + + // this.$forceUpdate() + } + }, + handleLocation (val, index) { + this.activeNum = index + window.layerFactory.flyByFeature(val, this.form.dataType.code) } } } @@ -46,13 +127,88 @@ <style lang="less"> .affiliatedFacilities-dialog{ - width: calc(30% - 15px) !important; // calc(30% - 15px); - left: 50%; + width: calc(20% - 60px) !important; // calc(30% - 15px); + left: 60%; .el-dialog__body{ padding: 0.04rem; - h3{color:#fff;} - ul {display: flex;flex-wrap: wrap; - li{margin-left:0.04rem;margin-bottom: 0.04rem;cursor: pointer;color:#00fff6} + .search-panel { + background-color: transparent; + padding: 10px; + border-bottom: 1px solid @background-color-split; + // .el-input{width:calc(100% - 40px);position: relative} + /deep/ input { + border-radius: 0; + background-color: @background-color-split; + border: solid 1px @color; + color: @color-gray; + font-size: 0.01rem; + padding: 0 15px; + + .el-select .el-input.is-focus .el-input__inner { + border-color: @color; + } + } + .el-form-item__label{ + color:#00fff6 + } + .el-input__inner { + background: none; + color: #fff; + font-size: 14px; + border-radius: 0; + border-color: @color; + background: rgba(0, 16, 30, .5); + } + } + /*input 鐐瑰嚮鎼滅储鏍峰紡*/ + + .rightButtonSearch { + display: flex; + justify-content: space-between; + align-items: center; + + .el-input { + margin-right: 10px + } + + .el-icon-search { + width: 40px; + border: 1px solid @color; + height: 28px; + line-height: 28px; + text-align: center; + color: #fff; + border-radius: 2px; + cursor: pointer; + background: rgba(0, 16, 30, .5); + padding: 0; + } + } + .environmental-risk-list { + position: relative; + padding-left: 50px; + padding-top: 5px; + padding-bottom: 5px; + color: @color-shadow; + border-bottom: 1px solid @background-color-split; + h3{ cursor: pointer;} + .state { + width: 30px; + height: 30px; + position: absolute; + top: 50%; + left: 10px; + margin-top: -15px; + border-radius: 50%; + box-shadow: 0 0 3px #000; + background: #0B3B6D; + } + } + + .environmental-risk-list.hover, + .environmental-risk-list:hover { + color: @color-highlight; + background: @background-color; } } } diff --git a/src/components/panel/RightSearchPanel.vue b/src/components/panel/RightSearchPanel.vue index 85064fc..17cc936 100644 --- a/src/components/panel/RightSearchPanel.vue +++ b/src/components/panel/RightSearchPanel.vue @@ -600,13 +600,12 @@ .environmental-risk-list { position: relative; - cursor: pointer; padding-left: 50px; padding-top: 5px; padding-bottom: 5px; color: @color-shadow; border-bottom: 1px solid @background-color-split; - + h3{ cursor: pointer;} .state { width: 30px; height: 30px; @@ -622,7 +621,7 @@ .environmental-risk-list.hover, .environmental-risk-list:hover { - color: @color-over; + color: @color-highlight; background: @background-color; } diff --git a/src/components/panel/topicSearch/SewersSearch.vue b/src/components/panel/topicSearch/SewersSearch.vue index e44b703..706f5e2 100644 --- a/src/components/panel/topicSearch/SewersSearch.vue +++ b/src/components/panel/topicSearch/SewersSearch.vue @@ -17,30 +17,30 @@ </el-select> </el-form-item> <el-form-item :label="form.pipelineType+'锛�'" size="mini"> - <el-select style="width: 100%" v-model="form.dataType" value-key="code" :popper-class="'select-down'"> - <!-- @change="handleDataType"--> + <el-select style="width: 100%" v-model="form.dataType" value-key="code" :popper-class="'select-down'" @change="handleDataType" > <el-option - v-for="item in subItems" - :key="item.code" - :label="item.name" - :value="item"> - </el-option> + v-for="item in subItems" + :key="item.code" + :label="item.name" + :value="item"> + </el-option> </el-select> </el-form-item> <div class="rightButtonSearch"> - <el-input v-model="form.keyword" size="mini" placeholder="鍦ㄦ杈撳叆鍏抽敭瀛楁悳绱�"> - </el-input> + <el-input v-model="form.keyword" size="mini" placeholder="鍦ㄦ杈撳叆鍏抽敭瀛楁悳绱�"></el-input> <el-button class="el-icon-search" @click="handleSearch"></el-button> </div> </el-form> </div> <el-scrollbar style="height:380.44px;"> - <div class="environmental-risk-list" v-for="(item,index) in list" :key="index"> + <div class="environmental-risk-list" v-for="(item,index) in list" :key="index" :class="activeNum==index?'hover':''"> <img class="state" :src="getImgSrc()" style="background: none"/> <div> - <h3 @click="handleLocation(item)">{{ item.properties.pipename }}</h3> + <h3 @click="handleLocation(item,index)">{{ item.properties.pipename }}</h3> <p>鎵�灞炰紒涓氾細<span>{{ item.properties.orgcode }}</span> - <p>璁炬柦绫诲瀷锛�<span>{{ item.properties.teetype }}</span> <el-button class="rt" size="mini" style="margin-right: 0.04rem" @click="btnAffiliatedFacilities(item)" >闄勫睘璁炬柦</el-button></p> + <p>璁炬柦绫诲瀷锛�<span>{{ item.properties.teetype }}</span> + <!-- <el-button v-if="fuShuSheShiShow" class="rt" size="mini" style="margin-right: 0.04rem" @click="btnAffiliatedFacilities(item)" >闄勫睘璁炬柦</el-button> --> + </p> </div> </div> </el-scrollbar> @@ -65,7 +65,7 @@ </el-tab-pane> </el-tabs> <!-- 闄勫睘璁炬柦闈㈡澘 --> - <affiliated-facilities></affiliated-facilities> + <affiliated-facilities :facilitiesParameter="facilitiesParameter" :fuShuSheShiSubItems="fuShuSheShiSubItems" ></affiliated-facilities> </div> </template> @@ -108,7 +108,11 @@ // pageSize: 10, // current: 1, isWaybillHover: true, - isRouteHover: false + isRouteHover: false, + facilitiesParameter: null, + // fuShuSheShiShow: false, + + activeNum: -1 } }, props: ['title'], @@ -120,8 +124,11 @@ handleClick (tab, event) { console.log(tab, event) }, + // 璁炬柦绫诲瀷绛涢�� handlePipelineType (val) { - for (var i = 0; i < this.items.length; i++) { + this.list = [] + // debugger + for (let i = 0; i < this.items.length; i++) { const item = this.items[i] if (val === item.name) { this.subItems = item.layers @@ -129,7 +136,12 @@ } } }, + handleDataType () { + this.list = [] + }, async handleSearch () { + // console.log(this.form.dataType.sname, this.form.keyword) + this.list = [] var wfsHelper = new WfsHelper() // todo 鐜板湪绠$綉杩樻病鍖哄垎寮�绫诲瀷锛屽悗闈㈡敼 wfsHelper.addTypeName(this.form.dataType.sname) @@ -141,12 +153,22 @@ this.list = res.features } }, - handleLocation (val) { - window.layerFactory.flyByFeature(val, this.form.dataType.code) + handleLocation (val, index) { + this.activeNum = index + + this.facilitiesParameter = val // layer && layer.openPopup() - }, - btnAffiliatedFacilities (item) { - console.log(item) + // 鍒ゆ柇閫夋嫨鏄惁鏄绾匡紝濡傛灉鏄垯鏄剧ず銆婇檮灞炶鏂姐�嬪脊妗� + /* if (this.form.pipelineType === '绠$嚎') { + for (let i = 0; i < this.items.length; i++) { + const item = this.items[i] + if (item.name === '闄勫睘璁炬柦') { + this.fuShuSheShiSubItems = item.layers + // console.log(this.fuShuSheShiSubItems) + } + } + } */ + window.layerFactory.flyByFeature(val, this.form.dataType.code) } } } diff --git a/src/conf/Topic.js b/src/conf/Topic.js index 5d8cd46..9bc0bb5 100644 --- a/src/conf/Topic.js +++ b/src/conf/Topic.js @@ -60,7 +60,7 @@ isShow: true, icon: 'iconguanxianxuncha', comp: '' -}, { +} /* { name: '绠¢亾鍙樻洿', id: 8, checked: false, @@ -74,4 +74,4 @@ isShow: true, icon: 'iconguanxianbiaozhu', comp: '' -}] +} */] -- Gitblit v1.8.0