Commit 74307dbf authored by 范加坤's avatar 范加坤

样式调整

parent e752c89b
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
</template> </template>
<script> <script>
import { mapActions } from "vuex"; import { mapActions } from 'vuex'
export default { export default {
data() { data() {
return {}; return {}
}, },
created() { created() {
this.getRegionProvince(); this.getRegionProvince()
}, },
methods: { methods: {
...mapActions(["getRegionProvince"]), ...mapActions(['getRegionProvince'])
}, }
}; }
</script> </script>
<style lang="less"> <style lang="less">
...@@ -29,12 +29,15 @@ body { ...@@ -29,12 +29,15 @@ body {
height: 100%; height: 100%;
} }
#app { #app {
font-family: Avenir, Helvetica, Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC,
Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial,
sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
font-weight: 700;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
// text-align: center; // text-align: center;
color: #fff; color: #fff;
background: url("./assets/img/bg.png") no-repeat; background: url('./assets/img/bg.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
background-position: center; background-position: center;
background-attachment: fixed; background-attachment: fixed;
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
// 各模块简单基本样式 // 各模块简单基本样式
.part { .part {
height: 100%; // height: 100%;
padding: 1.2vh; padding: 1.2vh;
min-height: 9vh; min-height: 9vh;
box-sizing: border-box; box-sizing: border-box;
......
<template> <template>
<div class="statusControl" :style="statusStyle"> <div :class="['wrap', isShow ? 'isShowWrap' : 'noShowWrap']">
<ul> <div class="this_active" @click="() => (isShow = !isShow)">
<li <span>{{ value.value }} </span>
v-for="(item, index) in list" <i
:key="index" :class="isShow ? 'el-icon-d-arrow-left' : 'el-icon-d-arrow-right'"
:class="{ acitive: value.key === item.key }" style="color: #fff"
@click="onStatusChange(item)" ></i>
> </div>
{{ item.value }} <div class="statusControl" v-show="isShow" :style="statusStyle">
</li> <ul>
</ul> <li
v-for="(item, index) in list"
:key="index"
:class="{ acitive: value.key === item.key }"
@click="onStatusChange(item)"
>
{{ item.value }}
</li>
</ul>
</div>
</div> </div>
</template> </template>
<script> <script>
// #144683 // #144683
export default { export default {
name: "statusControl", name: 'statusControl',
props: { props: {
list: { list: {
type: Array, type: Array,
default: function () { default: function () {
return []; return []
}, }
}, },
statusStyle: { statusStyle: {
type: [Object, String], type: [Object, String],
default: "", default: ''
}, },
value: { value: {
type: Object, type: Object,
default: function () { default: function () {
return {}; return {}
}, }
}, }
}, },
data() { data() {
return {}; return {
isShow: false
}
}, },
methods: { methods: {
onStatusChange(item) { onStatusChange(item) {
this.$emit("input", item); this.$emit('input', item)
}, this.isShow = false
}, }
}; }
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.wrap {
overflow: hidden;
width: auto;
}
.isShowWrap {
// border-radius: 30px;
.this_active {
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
}
.noShowWrap {
.this_active {
width: 200px;
border-radius: 22.5px;
}
}
.this_active {
// width: 100%;
line-height: 45px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 18px 0 25px;
box-sizing: border-box;
background-color: #16ceaf;
}
.statusControl { .statusControl {
ul li { background-color: hsla(0, 0%, 100%, 0.5);
margin-bottom: 10px; width: 340px;
border-radius: 15px; padding: 15px;
padding: 5px 10px; border-bottom-left-radius: 3px;
width: 170px; border-bottom-right-radius: 3px;
color: #84c6ff; ul {
// background-color: #fff; display: flex;
box-shadow: 0 0 5px #fff9; flex-wrap: wrap;
text-align: center; justify-content: space-between;
cursor: pointer; li {
border: 1px solid #84c6ff; margin-bottom: 10px;
&.acitive { margin-top: 10px;
color: #fff; border-radius: 15px;
background-color: #16ceaf; padding: 5px 10px;
width: 160px;
box-sizing: border-box;
color: #84c6ff;
// background-color: #fff;
box-shadow: 0 0 2px #fff9;
text-align: center;
cursor: pointer;
border: 1px solid #84c6ff;
background-color: #fff;
&.acitive {
color: #fff;
background-color: #16ceaf;
}
} }
} }
} }
......
...@@ -360,7 +360,7 @@ export default { ...@@ -360,7 +360,7 @@ export default {
} }
.left-part { .left-part {
z-index: 99; z-index: 99;
// display: flex; display: flex;
// flex-direction: column; // flex-direction: column;
height: 55vh; height: 55vh;
// width: 250px; // width: 250px;
...@@ -370,7 +370,7 @@ export default { ...@@ -370,7 +370,7 @@ export default {
z-index: 100; z-index: 100;
.left-part-item { .left-part-item {
height: 5vh; height: 5vh;
margin-bottom: 1vh; margin-right: 1vh;
} }
} }
.bottom-part { .bottom-part {
...@@ -403,9 +403,9 @@ export default { ...@@ -403,9 +403,9 @@ export default {
} }
.status-control { .status-control {
position: absolute; position: absolute;
right: 1vw; left: 1vw;
top: 12vh; top: 21vh;
z-index: 99; z-index: 999;
} }
} }
</style> </style>
......
...@@ -88,8 +88,8 @@ export default { ...@@ -88,8 +88,8 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
.leftPart { .leftPart {
display: flex; display: flex;
flex-direction: column; // flex-direction: column;
width: 250px; // width: 250px;
position: absolute; position: absolute;
top: 11vh; top: 11vh;
left: 1vw; left: 1vw;
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
left: 280px; left: 280px;
} }
.left-part-item { .left-part-item {
margin-bottom: 2vh; margin-right: 2vw;
} }
} }
</style> </style>
...@@ -8,11 +8,7 @@ ...@@ -8,11 +8,7 @@
:data="data" :data="data"
:provinceCode="provinceCode" :provinceCode="provinceCode"
></BiogasManureMap> ></BiogasManureMap>
<StatusControl
:statusStyle="{ position: 'absolute', right: '27.7vw', top: '100px' }"
:list="statusControlList"
v-model="statusValue"
></StatusControl>
<SortList :type="statusValue.key" @barClick="barClick"></SortList> <SortList :type="statusValue.key" @barClick="barClick"></SortList>
<!-- 表格数据展示 --> <!-- 表格数据展示 -->
<Table :type="statusValue.key" :data="data"></Table> <Table :type="statusValue.key" :data="data"></Table>
...@@ -28,15 +24,17 @@ ...@@ -28,15 +24,17 @@
</div> </div>
</PartWrap> </PartWrap>
</div> </div>
<StatusControl <div class="status_control_wrap">
:statusStyle="{ <StatusControl
position: 'absolute', :list="statusControlList"
right: '27.7vw', v-model="statusValue"
bottom: '30.5vh', ></StatusControl>
}" <StatusControl
:list="getAllItemOfType" class="StatusControl"
v-model="allItemValue" :list="getAllItemOfType"
></StatusControl> v-model="allItemValue"
></StatusControl>
</div>
<Legend <Legend
class="legendPart" class="legendPart"
:colors="color" :colors="color"
...@@ -46,36 +44,36 @@ ...@@ -46,36 +44,36 @@
</template> </template>
<script> <script>
import PartWrap from "@/components/PartWrap/PartWrap.vue"; import PartWrap from '@/components/PartWrap/PartWrap.vue'
import Echart from "@/components/Echart/Echarts.vue"; import Echart from '@/components/Echart/Echarts.vue'
import StatusControl from "@/components/statusControl/index.vue"; import StatusControl from '@/components/statusControl/index.vue'
import Legend from "@/components/Lengend/Lengend.vue"; import Legend from '@/components/Lengend/Lengend.vue'
import { getCodeOfName } from "@/config/city.config"; import { getCodeOfName } from '@/config/city.config'
import BiogasManureMap from "./components/biogasManureMap.vue"; import BiogasManureMap from './components/biogasManureMap.vue'
import LeftPart from "./components/leftPart.vue"; import LeftPart from './components/leftPart.vue'
import SortList from "./components/sortList.vue"; import SortList from './components/sortList.vue'
import Table from "./components/table.vue"; import Table from './components/table.vue'
import { BiomassData } from "./config/biomass.config.js"; import { BiomassData } from './config/biomass.config.js'
import { color, colorLabel } from "./config/legend.config"; import { color, colorLabel } from './config/legend.config'
import { mapGetters } from "vuex"; import { mapGetters } from 'vuex'
export default { export default {
name: "BiomassEnergyWarm", name: 'BiomassEnergyWarm',
data() { data() {
return { return {
statusControlList: [ statusControlList: [
{ key: "gn", value: "打捆直燃集中供暖" }, { key: 'gn', value: '打捆直燃集中供暖' },
{ key: "ghcx", value: "固化成型" }, { key: 'ghcx', value: '固化成型' },
{ key: "rj", value: "热解气化" }, { key: 'rj', value: '热解气化' },
{ key: "th", value: "碳化" }, { key: 'th', value: '碳化' }
], ],
statusValue: { key: "gn", value: "打捆直燃集中供暖" }, statusValue: { key: 'gn', value: '打捆直燃集中供暖' },
dataSetCode: "ra_energy_heating", dataSetCode: 'ra_energy_heating',
data: [], data: [],
color, color,
colorLabel, colorLabel,
provinceCode: "", provinceCode: '',
allItemValue: { key: "gn_local", value: "数量(处)" }, allItemValue: { key: 'gn_local', value: '数量(处)' }
}; }
}, },
components: { components: {
PartWrap, PartWrap,
...@@ -85,53 +83,53 @@ export default { ...@@ -85,53 +83,53 @@ export default {
StatusControl, StatusControl,
SortList, SortList,
Table, Table,
Legend, Legend
}, },
computed: { computed: {
getItemOfType() { getItemOfType() {
return BiomassData[this.statusValue.key].find( return BiomassData[this.statusValue.key].find(
(item) => item.type === "aggregation" item => item.type === 'aggregation'
); )
}, },
getAllItemOfType() { getAllItemOfType() {
return BiomassData[this.statusValue.key]; return BiomassData[this.statusValue.key]
}, },
getValOfdata() { getValOfdata() {
const res = { const res = {
[this.getItemOfType.key]: [], [this.getItemOfType.key]: []
}; }
this.data.forEach((item) => { this.data.forEach(item => {
res[this.getItemOfType.key].push({ res[this.getItemOfType.key].push({
xAxis: item.properties.pname, xAxis: item.properties.pname,
yAxis: item.properties[this.getItemOfType.key], yAxis: item.properties[this.getItemOfType.key]
}); })
}); })
return res; return res
}, },
setOptionOfEchart() { setOptionOfEchart() {
return function (type) { return function (type) {
const data = this.getValOfdata[type] const data = this.getValOfdata[type]
.filter((item) => item.yAxis) .filter(item => item.yAxis)
.sort((a, b) => b.yAxis - a.yAxis); .sort((a, b) => b.yAxis - a.yAxis)
const xData = data.map((item) => item.xAxis); const xData = data.map(item => item.xAxis)
const yData = data.map((item) => item.yAxis); const yData = data.map(item => item.yAxis)
const option = { const option = {
title: {}, title: {},
color: ["#d65108"], color: ['#d65108'],
tooltip: { tooltip: {
show: true, show: true
}, },
grid: { grid: {
left: "3%", left: '3%',
right: "3%", right: '3%',
top: "10%", top: '10%',
bottom: "3%", bottom: '3%',
containLabel: true, containLabel: true
}, },
yAxis: [ yAxis: [
{ {
type: "value", type: 'value',
// splitLine: { // splitLine: {
// lineStyle: { // lineStyle: {
// color: "rgba(255,255,255,.15)", // color: "rgba(255,255,255,.15)",
...@@ -139,101 +137,101 @@ export default { ...@@ -139,101 +137,101 @@ export default {
// }, // },
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: "#fff", color: '#fff'
}, }
}, }
}, }
], ],
xAxis: [ xAxis: [
{ {
position: "bottom", position: 'bottom',
type: "category", type: 'category',
data: xData, data: xData,
axisTick: { axisTick: {
show: false, show: false
}, },
axisLine: { axisLine: {
show: false, show: false
}, },
axisLabel: { axisLabel: {
color: "#fff", color: '#fff'
}, }
}, }
], ],
series: [ series: [
{ {
name: "", name: '',
type: "bar", type: 'bar',
barWidth: `50%`, barWidth: `50%`,
data: yData, data: yData,
label: { label: {
show: true, show: true,
position: "top", position: 'top'
}, },
itemStyle: { itemStyle: {
// emphasis: { // emphasis: {
// color: "rgba(201,59,60)", // color: "rgba(201,59,60)",
// }, // },
}, }
}, }
], ]
}; }
return option; return option
}; }
}, },
// 获取所有值 // 获取所有值
getRandomLabel() { getRandomLabel() {
const obj = BiomassData[this.statusValue.key].find( const obj = BiomassData[this.statusValue.key].find(
(item) => item.key === this.allItemValue.key item => item.key === this.allItemValue.key
); )
const res = []; const res = []
this.data.forEach((item) => { this.data.forEach(item => {
res.push(item.properties[obj.key]); res.push(item.properties[obj.key])
}); })
return [...new Set(res)].filter((item) => item).sort((a, b) => a - b); return [...new Set(res)].filter(item => item).sort((a, b) => a - b)
}, },
// 根据值生产颜色段 // 根据值生产颜色段
getRandomColorLabel() { getRandomColorLabel() {
const labels = this.getRandomLabel; const labels = this.getRandomLabel
const min = labels[0]; const min = labels[0]
const max = labels[labels.length - 1]; const max = labels[labels.length - 1]
const colorLabels = []; const colorLabels = []
const part = (max - min) / 4; const part = (max - min) / 4
for (let i = 1; i <= 4; i++) { for (let i = 1; i <= 4; i++) {
colorLabels.push(Number((part * i - 1).toFixed(4))); colorLabels.push(Number((part * i - 1).toFixed(4)))
} }
return colorLabels; return colorLabels
}, },
...mapGetters(["getMsgOfProvince"]), ...mapGetters(['getMsgOfProvince'])
}, },
created() { created() {
this.getEnergyWarm(); this.getEnergyWarm()
}, },
methods: { methods: {
getEnergyWarm() { getEnergyWarm() {
const param = { const param = {
filter: ["!=", "pcode", 10], filter: ['!=', 'pcode', 10]
}; }
this.$api.layer.query(this.dataSetCode, param).then((res) => { this.$api.layer.query(this.dataSetCode, param).then(res => {
this.data = res.data.features; this.data = res.data.features
this.getValOfdata; this.getValOfdata
}); })
}, },
barClick(name) { barClick(name) {
console.log(name); console.log(name)
const code = getCodeOfName(name.name); const code = getCodeOfName(name.name)
code && (this.provinceCode = code); code && (this.provinceCode = code)
}, }
}, },
watch: { watch: {
statusValue: { statusValue: {
handler(val) { handler(val) {
this.allItemValue = BiomassData[val.key][0]; this.allItemValue = BiomassData[val.key][0]
}, },
deep: true, deep: true
}, }
}, }
}; }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
...@@ -259,8 +257,16 @@ export default { ...@@ -259,8 +257,16 @@ export default {
.legendPart { .legendPart {
position: absolute; position: absolute;
z-index: 11; z-index: 11;
left: 300px; left: 1vw;
bottom: 30.5vh; bottom: 30.5vh;
} }
.status_control_wrap {
position: absolute;
left: 1vw;
top: 21vh;
.StatusControl{
margin-top: 1vh;
}
}
} }
</style> </style>
This diff is collapsed.
...@@ -17,12 +17,9 @@ ...@@ -17,12 +17,9 @@
:yearValue="yearValue" :yearValue="yearValue"
@showPopup="isShowPopup" @showPopup="isShowPopup"
></EnergyVillageMap> ></EnergyVillageMap>
<StatusControl <div class="statusControl" @click="onStatusChange">
class="statusControl" {{ statusValue.value }}
:list="statusControlList" </div>
:value="showFilter"
@input="onStatusChange"
></StatusControl>
<!-- <Table class="table"></Table> --> <!-- <Table class="table"></Table> -->
<SortList <SortList
:provinceCode="statusValue.key" :provinceCode="statusValue.key"
...@@ -30,7 +27,7 @@ ...@@ -30,7 +27,7 @@
:yearValue="yearValue" :yearValue="yearValue"
></SortList> ></SortList>
<FilterProvince <FilterProvince
v-if="showFilter.key" v-if="showFilter"
class="filterProvince" class="filterProvince"
@onAddressChange="onAddressChange" @onAddressChange="onAddressChange"
></FilterProvince> ></FilterProvince>
...@@ -39,93 +36,94 @@ ...@@ -39,93 +36,94 @@
</template> </template>
<script> <script>
import { mapActions, mapState } from "vuex"; import { mapActions, mapState } from 'vuex'
import PartWrap from "@/components/PartWrap/PartWrap.vue"; import PartWrap from '@/components/PartWrap/PartWrap.vue'
import StatusControl from "@/components/statusControl/index.vue"; // import StatusControl from '@/components/statusControl/index.vue'
import { getCodeOfName } from "@/config/city.config"; import { getCodeOfName } from '@/config/city.config'
import DateWidget from "@/components/DateWidget/DateWidget.vue"; import DateWidget from '@/components/DateWidget/DateWidget.vue'
import EnergyVillageMap from "./components/energyVillageMap.vue"; import EnergyVillageMap from './components/energyVillageMap.vue'
// import Table from "./components/table.vue"; // import Table from "./components/table.vue";
import FilterProvince from "./components/filterProvince.vue"; import FilterProvince from './components/filterProvince.vue'
import SortList from "./components/sortList.vue"; import SortList from './components/sortList.vue'
import PicPopup from "./components/picPopup.vue"; import PicPopup from './components/picPopup.vue'
export default { export default {
name: "RenewableEnergyVillage", name: 'RenewableEnergyVillage',
components: { components: {
PartWrap, PartWrap,
EnergyVillageMap, EnergyVillageMap,
// Table, // Table,
StatusControl, // StatusControl,
SortList, SortList,
FilterProvince, FilterProvince,
DateWidget, DateWidget,
PicPopup, PicPopup
}, },
created() { created() {
this.getData(); this.getData()
}, },
data() { data() {
return { return {
statusControlList: [{ key: "province", value: "省份筛选" }], statusControlList: [{ key: 'province', value: '省份筛选' }],
showFilter: {}, showFilter: '',
statusValue: {}, statusValue: { value: '全国' },
yearRange: [], yearRange: [],
yearValue: "", yearValue: '',
showPopup: false, showPopup: false,
popupId: "", popupId: ''
}; }
}, },
computed: { computed: {
getYearRange() { getYearRange() {
let yearRange = []; let yearRange = []
this.data.features.forEach((item) => { this.data.features.forEach(item => {
let year = item.properties.vliiage_year; let year = item.properties.vliiage_year
if (!yearRange.find((item) => item === year)) { if (!yearRange.find(item => item === year)) {
yearRange.push(year); yearRange.push(year)
} }
}); })
let max = Math.max(...yearRange); let max = Math.max(...yearRange)
let min = Math.min(...yearRange); let min = Math.min(...yearRange)
return [String(min), String(max)]; return [String(min), String(max)]
}, },
getCount() { getCount() {
return this.data.features.filter( return this.data.features.filter(
(item) => item.properties.vliiage_year === this.yearValue item => item.properties.vliiage_year === this.yearValue
); )
}, },
...mapState("energyVillage", ["data"]), ...mapState('energyVillage', ['data'])
}, },
methods: { methods: {
onStatusChange(e) { onStatusChange() {
if (e.key === this.showFilter.key) { // if (e.key === this.showFilter.key) {
this.showFilter = {}; // this.showFilter = {}
} else { // } else {
this.showFilter = e; this.showFilter = true
} // }
}, },
barClick(name) { barClick(name) {
const code = getCodeOfName(name.name); const code = getCodeOfName(name.name)
code && (this.statusValue = { key: code, value: name }); code && (this.statusValue = { key: code, value: name })
}, },
onAddressChange(item) { onAddressChange(item) {
this.statusValue = { this.statusValue = {
key: item.province_code, key: item.province_code,
value: item.province, value: item.province
}; }
this.showFilter = false
}, },
dateChange(e) { dateChange(e) {
this.yearValue = e; this.yearValue = e
}, },
isShowPopup(id) { isShowPopup(id) {
this.popupId = id; this.popupId = id
if (id === "14") { if (id === '14') {
this.showPopup = true; this.showPopup = true
} }
}, },
...mapActions("energyVillage", ["getData"]), ...mapActions('energyVillage', ['getData'])
}, }
}; }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -168,6 +166,16 @@ export default { ...@@ -168,6 +166,16 @@ export default {
position: absolute; position: absolute;
top: 11vh; top: 11vh;
right: calc(3vh + 13vw); right: calc(3vh + 13vw);
border-radius: 15px;
padding: 5px 10px;
width: 130px;
box-sizing: border-box;
color: #fff;
background-color: #16ceaf;
box-shadow: 0 0 5px #fff9;
text-align: center;
cursor: pointer;
border: 1px solid #84c6ff;
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment