From 417e07eebf6313b19ab6d26ebd8e39c7d08516ea Mon Sep 17 00:00:00 2001 From: TreeWish <1131093754@qq.com> Date: 星期五, 24 二月 2023 19:39:28 +0800 Subject: [PATCH] 解决收缩菜单不一致情况 --- src/components/Screen/top.vue | 8 +++ src/views/Thematic/index.vue | 29 ++++++++++---- src/components/chart/DataStorage.vue | 1 src/components/Screen/ProjectTree.vue | 2 src/components/Screen/mapsdk.vue | 2 src/components/Screen/right.vue | 38 ++++-------------- 6 files changed, 39 insertions(+), 41 deletions(-) diff --git a/src/components/Screen/ProjectTree.vue b/src/components/Screen/ProjectTree.vue index e2478cf..7fec0d7 100644 --- a/src/components/Screen/ProjectTree.vue +++ b/src/components/Screen/ProjectTree.vue @@ -209,7 +209,7 @@ <style lang="scss" scoped> .project_tree { margin: 0; - width: 300px; + width: 100%; height: 100%; transition: width 2s; background: url("~@/assets/img/Screen/prjectree.png") no-repeat center; diff --git a/src/components/Screen/mapsdk.vue b/src/components/Screen/mapsdk.vue index 7439642..c61a0c5 100644 --- a/src/components/Screen/mapsdk.vue +++ b/src/components/Screen/mapsdk.vue @@ -31,7 +31,7 @@ "" ) } - if (name.includes("绠$綉")) { + if (name == '鍏ㄧ悆椤圭洰') { yunxuanLayer.item.show = true } else { yunxuanLayer.item.show = false diff --git a/src/components/Screen/right.vue b/src/components/Screen/right.vue index 5e9e2f5..bb7186f 100644 --- a/src/components/Screen/right.vue +++ b/src/components/Screen/right.vue @@ -5,7 +5,7 @@ <div class="aside-title">宸ョ▼绉嶇被</div> <project-category></project-category> </div> - <div class="" style="height: 60%"> + <div class="" style="width: 100%;height: 60%"> <div class="aside-title">鏂囦欢鏍煎紡</div> <div class="content" style="height: calc(100% - 30px)"> <div class="header"> @@ -79,33 +79,13 @@ provinceData: [], } }, - created() { - // this.getCountryData() - // this.getProvinceData() - }, - mounted() { - // const countryData = this.countryData - // const provinceData = this.provinceData - // this.$refs.barRef.initChart(countryData) - // this.$refs.pieRef.initChart(countryData) + mounted() { this.$bus.$on("changeProject", name => { this.currentProject = name }) }, methods: { - async getCountryData() { - const res = await countCountryDimension() - if (res.code == 200) { - this.countryData = res.result - } - }, - async getProvinceData() { - const res = await countProvinceDimension() - if (res.code == 200) { - this.provinceData = res.result - } - }, ChangeRight() { if (this.leftMessage == "init") { if (this.ChartDisplay) { @@ -117,15 +97,15 @@ } if (this.leftMessage == "projectree") { - if (this.ProjectreeDisplay) { + if (this.CourtyDisplay) { this.RightImg = require("../../assets/img/Screen/leftArrow.png") } else { this.RightImg = require("../../assets/img/Screen/rightArrow.png") } - this.ProjectreeDisplay = !this.ProjectreeDisplay + this.CourtyDisplay = !this.CourtyDisplay } - this.ChartDisplay = !this.ChartDisplay + // this.ChartDisplay = !this.ChartDisplay this.$parent.ChangeWidth("right") }, //鎵撳紑澶у睆宸︿晶鐣岄潰 @@ -134,7 +114,7 @@ this.CourtyDisplay = false this.leftMessage = "init" // this.OpenLeftInitChart(); - this.$parent.ChangeWidth("leftTree") + // this.$parent.ChangeWidth("leftTree") }, //鎵撳紑宸ョ▼鏍� @@ -169,7 +149,7 @@ } .rightContainer { height: 100%; - width: calc(100% - 7px); + width: calc(100% - 45px); display: flex; flex-direction: column; @@ -185,7 +165,7 @@ } .rightContainer2 { height: 100%; - width: calc(100% - 7px); + width: calc(100% - 45px); display: flex; flex-direction: column; @@ -202,7 +182,7 @@ } } .content { - width: 377px; + width: 100%; background: url(../../assets/img/Screen/contentBg.png); background-size: 100% 100%; background-repeat: no-repeat; diff --git a/src/components/Screen/top.vue b/src/components/Screen/top.vue index 8257b80..8244818 100644 --- a/src/components/Screen/top.vue +++ b/src/components/Screen/top.vue @@ -38,7 +38,13 @@ currView: "chart", } }, - mounted() {}, + mounted() { + this.$bus.$on('changeProject', name => { + if (name == '鍏ㄥ浗椤圭洰' || name == '鍏ㄧ悆椤圭洰') { + this.OpenProjectree() + } + }) + }, methods: { ReturnLast() { this.$router.push("/Synthesis") diff --git a/src/components/chart/DataStorage.vue b/src/components/chart/DataStorage.vue index 5814017..edf4eb4 100644 --- a/src/components/chart/DataStorage.vue +++ b/src/components/chart/DataStorage.vue @@ -136,7 +136,6 @@ num: item.鏂囦欢鏁�, } }) - console.log(count) this.config1.number = [count] this.config1 = { ...this.config1, diff --git a/src/views/Thematic/index.vue b/src/views/Thematic/index.vue index ccb777b..16d74df 100644 --- a/src/views/Thematic/index.vue +++ b/src/views/Thematic/index.vue @@ -2,7 +2,11 @@ <div class="themaic"> <mapsdk></mapsdk> <top class="title" ref="title"></top> - <left class="mapleft" :style="{ width: leftWidth }" ref="mapleft"></left> + <left + class="mapleft" + :style="{ width: leftWidth, left: leftTree && leftWidth == '20%' ? '-14px' : '0' }" + ref="mapleft" + ></left> <right class="mapright" :style="{ width: rightWidth }" @@ -25,7 +29,9 @@ data() { return { leftWidth: "20%", - rightWidth: "20%", + rightWidth: "22%", + leftTree: false, + currTree: false } }, mounted() {}, @@ -35,21 +41,28 @@ ChangeWidth(parm) { if (parm == "left") { if (this.leftWidth == "20%") { - this.leftWidth = "36px" + this.leftWidth = "8px" } else { this.leftWidth = "20%" } } + if (parm == "leftView" || parm == "leftTree") { this.leftWidth = "20%" - this.rightWidth = "20%" + this.rightWidth = "22%" + } + if (parm == "leftView") { + this.leftTree = false + } + if (parm == "leftTree") { + this.leftTree = true } if (parm == "right") { - if (this.rightWidth == "20%") { - this.rightWidth = "36px" + if (this.rightWidth == "22%") { + this.rightWidth = "45px" } else { - this.rightWidth = "20%" + this.rightWidth = "22%" } } }, @@ -86,7 +99,7 @@ .mapright { position: absolute; top: 90px; - right: 0px; + right: -20px; // width: 20%; height: calc(100% - 180px); z-index: 999; -- Gitblit v1.9.3