From 1f2a2b5f470489b96e4dc8d38e483f1f2df1dbef Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Tue, 2 Aug 2022 16:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=82=AE=E7=AD=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/scss/modules/visual/c/common.scss | 20 +++++ src/views/modules/visual/command/cpts/map.vue | 37 ++++++-- .../modules/visual/command/cpts/popup.vue | 88 +++++++++++++++---- 3 files changed, 122 insertions(+), 23 deletions(-) diff --git a/src/assets/scss/modules/visual/c/common.scss b/src/assets/scss/modules/visual/c/common.scss index 0f86e52d..c7900667 100644 --- a/src/assets/scss/modules/visual/c/common.scss +++ b/src/assets/scss/modules/visual/c/common.scss @@ -17,3 +17,23 @@ background: darken(#0c81fe, 20); } } + +@mixin scrollBar2 { + &::-webkit-scrollbar { + /*滚动条整体样式*/ + width: 8px; /*高宽分别对应横竖滚动条的尺寸*/ + height: 1px; + } + &::-webkit-scrollbar-thumb { + /*滚动条里面小方块*/ + border-radius: 8px; + box-shadow: inset 0 0 5px rgba(#000, 0.1); + background: linear-gradient(270deg, #999, #ddd); + } + &::-webkit-scrollbar-track { + /*滚动条里面轨道*/ + box-shadow: inset 0 0 5px rgba(#000, 0.1); + border-radius: 8px; + background: darken(#999, 20); + } +} diff --git a/src/views/modules/visual/command/cpts/map.vue b/src/views/modules/visual/command/cpts/map.vue index cb8530ce..8fdc9c92 100644 --- a/src/views/modules/visual/command/cpts/map.vue +++ b/src/views/modules/visual/command/cpts/map.vue @@ -10,7 +10,11 @@
切换浅色模式
- + @@ -564,10 +568,20 @@ export default { dotLayer2.on("click", (e) => { console.log("--------clickDot2", e); - this.handleClickDot( - e.feature.properties, - e.feature.geometry.coordinates - ); + if ( + e.feature.properties.dataList && + e.feature.properties.dataList.length == 1 + ) { + this.handleClickDot( + { ...e.feature.properties, ...e.feature.properties.dataList[0] }, + e.feature.geometry.coordinates + ); + } else { + this.handleClickDot( + { ...e.feature.properties, placeType: "list" }, + e.feature.geometry.coordinates + ); + } }); dotLayer2.on("mousemove", (e) => { @@ -577,6 +591,19 @@ export default { dotLayer2.on("unmousemove", (e) => {}); }, + handleClickDotBtn(type, info) { + console.log(type, info); + this.$emit("clickDotBtn", type, info); + }, + + handleClickDotListItem(item) { + console.log("handleClickDotListItem", item); + this.handleClickDot(item, [ + parseFloat(item.longitude), + parseFloat(item.latitude), + ]); + }, + async handleClickDot(item, posArr) { console.log("handleClickDot", item, posArr); const res = await this.$refs.popup.show(item); diff --git a/src/views/modules/visual/command/cpts/popup.vue b/src/views/modules/visual/command/cpts/popup.vue index 4e5bc33c..86d97237 100644 --- a/src/views/modules/visual/command/cpts/popup.vue +++ b/src/views/modules/visual/command/cpts/popup.vue @@ -1,7 +1,7 @@ @@ -343,7 +372,7 @@ export default { hidden: true, placeType: "", info: {}, - eventInfo: {}, + list: [], }; }, @@ -353,19 +382,30 @@ export default { mounted() {}, methods: { - toPeople() { - // this.showPeopleInfo = true; + handleClickBtn(type) { + this.$emit("operate", type, this.info); + }, + + handleClickListItem(item) { + console.log("handleClickListItem", item); + this.$emit("clickListItem", item); }, async show(item) { - const { placeType, id, latitude, longitude } = item; - if (!id || !placeType) { + console.log("-----------------show"); + const { placeType, latitude, longitude } = item; + if (!placeType) { return false; } if (!latitude || !longitude) { this.$message.warning("请先完善坐标位置"); return false; } + + if (placeType === "list") { + this.list = item.dataList; + } + if (placeType === "resi" || placeType === "special_resi") { await this.loadResi(item); } @@ -411,10 +451,6 @@ export default { return true; }, - confirm() { - console.log(1111111); - }, - async loadResi(info) { const url = "/epmetuser/icresiuser/resi-brief/" + info.id; // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution" @@ -696,11 +732,18 @@ export default {