540 lines
16 KiB
Vue
540 lines
16 KiB
Vue
<template>
|
||
<div class="box">
|
||
<div class="top">
|
||
<img src="../assets/客户侧总体用能情况分析/图层 2.png" alt="" />
|
||
<p>客户侧总体用能情况分析</p>
|
||
<img src="../assets/客户侧总体用能情况分析/反白稿.png" alt="" />
|
||
</div>
|
||
<div class="container">
|
||
<div class="left">
|
||
<div class="ztynqk">
|
||
<p class="title">总体用能情况</p>
|
||
<ul class="typeBox">
|
||
<li :class="res == '日' ? 'active' : ''" @click="res = '日'">日</li>
|
||
<li :class="res == '月' ? 'active' : ''" @click="res = '月'">月</li>
|
||
<li :class="res == '年' ? 'active' : ''" @click="res = '年'">年</li>
|
||
</ul>
|
||
<div class="bottom">
|
||
<div class="bottomBox">
|
||
<img src="../assets/客户侧总体用能情况分析/图标.png" alt="" />
|
||
<div class="box1">
|
||
<p>用电量(MWH)</p>
|
||
<p><span>84.00</span><span>-13.20%</span></p>
|
||
</div>
|
||
</div>
|
||
<div class="bottomBox">
|
||
<img src="../assets/客户侧总体用能情况分析/图标(1).png" alt="" />
|
||
<div class="box1">
|
||
<p>用蒸汽量(m2)</p>
|
||
<p><span>45.32</span><span>-23.20%</span></p>
|
||
</div>
|
||
</div>
|
||
<div class="bottomBox">
|
||
<img src="../assets/客户侧总体用能情况分析/组 3125.png" alt="" />
|
||
<div class="box1">
|
||
<p>用水量(m2)</p>
|
||
<p><span>56.00</span><span>-33.20%</span></p>
|
||
</div>
|
||
</div>
|
||
<div class="bottomBox">
|
||
<img src="../assets/客户侧总体用能情况分析/组 3124.png" alt="" />
|
||
<div class="box1">
|
||
<p>用汽量(m2)</p>
|
||
<p><span>37.00</span><span>43.20%</span></p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="ssfhzs"></div>
|
||
<div class="ynl"></div>
|
||
</div>
|
||
<div class="center">
|
||
<div id="map"></div>
|
||
<div class="yhzyfbqk"></div>
|
||
</div>
|
||
<div class="right">
|
||
<div class="yhhyzb"></div>
|
||
<div class="ynflzb"></div>
|
||
<div class="qyydlpm"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
<script>
|
||
import * as echarts from "echarts";
|
||
export default {
|
||
data() {
|
||
return {};
|
||
},
|
||
methods: {
|
||
initMap() {
|
||
//后端返回的数据
|
||
var data = [
|
||
{
|
||
name: "济南市",
|
||
value: 1,
|
||
coord: [117.000923, 36.675807],
|
||
},
|
||
{
|
||
name: "青岛市",
|
||
value: 2,
|
||
coord: [120.382639, 36.067082],
|
||
},
|
||
{
|
||
name: "淄博市",
|
||
value: 3,
|
||
coord: [118.059134, 36.804685],
|
||
},
|
||
{
|
||
name: "枣庄市",
|
||
value: 4,
|
||
coord: [117.557964, 34.856424],
|
||
},
|
||
{
|
||
name: "东营市",
|
||
value: 5,
|
||
coord: [118.674767, 37.434751],
|
||
},
|
||
{
|
||
name: "烟台市",
|
||
value: 6,
|
||
coord: [121.447935, 37.463822],
|
||
},
|
||
{
|
||
name: "潍坊市",
|
||
value: 7,
|
||
coord: [119.161756, 36.706774],
|
||
},
|
||
{
|
||
name: "济宁市",
|
||
value: 8,
|
||
coord: [116.587245, 35.415393],
|
||
},
|
||
{
|
||
name: "泰安市",
|
||
value: 9,
|
||
coord: [117.089415, 36.188078],
|
||
},
|
||
{
|
||
name: "威海市",
|
||
value: 10,
|
||
coord: [122.120419, 37.513068],
|
||
},
|
||
{
|
||
name: "日照市",
|
||
value: 11,
|
||
coord: [119.526888, 35.416377],
|
||
},
|
||
{
|
||
name: "临沂市",
|
||
value: 12,
|
||
coord: [118.356448, 35.104672],
|
||
},
|
||
{
|
||
name: "德州市",
|
||
value: 13,
|
||
coord: [116.357465, 37.434093],
|
||
},
|
||
{
|
||
name: "聊城市",
|
||
value: 14,
|
||
coord: [115.986869, 36.455829],
|
||
},
|
||
{
|
||
name: "滨州市",
|
||
value: 15,
|
||
coord: [118.016974, 37.383542],
|
||
},
|
||
{
|
||
name: "菏泽市",
|
||
value: 16,
|
||
coord: [115.469381, 35.246531],
|
||
},
|
||
];
|
||
var chartDom = document.getElementById("map");
|
||
var myChart = this.$echarts.init(chartDom, null, { renderer: "webgl" });
|
||
window.addEventListener("resize", function () {
|
||
myChart.resize();
|
||
});
|
||
//获取山东地图数据。
|
||
$.get(
|
||
"https://geo.datav.aliyun.com/areas_v3/bound/370000_full.json",
|
||
function (geojson) {
|
||
echarts.registerMap("山东", geojson);
|
||
let option = {
|
||
series: [
|
||
{
|
||
tooltip: {
|
||
trigger: "item",
|
||
// show: false,
|
||
},
|
||
name: "山东",
|
||
type: "map",
|
||
map: "山东",
|
||
boxDepth: 60, //地图倾斜度
|
||
regionHeight: 6, //地图厚度
|
||
aspectScale: 0.9, //地图长宽比
|
||
emphasis: {
|
||
itemStyle: {
|
||
areaColor: "#70EAF4", // 高亮时候地图显示的颜色
|
||
borderWidth: 2, // 高亮时的边框宽度
|
||
},
|
||
label: {
|
||
fontSize: "0.06rem", // 选中地图文字字号和字体颜色
|
||
color: "#fff",
|
||
},
|
||
},
|
||
label: {
|
||
show: true, //是否显示市
|
||
formatter: function (params) {
|
||
var name = params.name;
|
||
var value = params.value;
|
||
var text = ` {fline|${value}}\n{tline|${name}} `;
|
||
return text;
|
||
},
|
||
textStyle: {
|
||
color: "#000", //文字颜色
|
||
fontSize: "0.08rem", //文字大小
|
||
fontFamily: "微软雅黑",
|
||
// backgroundColor: {
|
||
// image: "../assets/客户侧总体用能情况分析/光标.png",
|
||
// },
|
||
// padding: [15, 20],
|
||
},
|
||
rich: {
|
||
fline: {
|
||
padding: [0, 35],
|
||
color: "#FDCC00",
|
||
fontSize: "0.07rem",
|
||
fontWeight: 600,
|
||
},
|
||
tline: {
|
||
padding: [0, 27],
|
||
color: "#fff",
|
||
fontSize: "0.06rem",
|
||
},
|
||
},
|
||
},
|
||
itemStyle: {
|
||
opacity: 0.8, // 透明度
|
||
borderWidth: 2, //分界线宽度
|
||
borderColor: "#0699E4", //分界线颜色
|
||
areaColor: {
|
||
x: 0.5,
|
||
y: 0.7,
|
||
r: 0.5,
|
||
colorStops: [
|
||
{
|
||
offset: 0,
|
||
color: "rgba(20,110,230,0.4)",
|
||
},
|
||
{
|
||
offset: 1,
|
||
color: "rgba(6,33,121,0.4)",
|
||
},
|
||
],
|
||
global: false, // 缺省为 false
|
||
},
|
||
},
|
||
groundplane: {
|
||
show: true,
|
||
},
|
||
data: data,
|
||
z: 999,
|
||
shading: "realistic",
|
||
// 真实感材质相关配置 shading: 'realistic'时有效
|
||
realisticMaterial: {
|
||
detailTexture: "rgb(0, 102, 204)", // 纹理贴图
|
||
textureTiling: 0, // 纹理平铺,1是拉伸,数字表示纹理平铺次数
|
||
roughness: 0.8, // 调整光照模型的粗糙度
|
||
metalness: 0.0, // 调整金属感,0.0 为非金属
|
||
roughnessAdjust: 0,
|
||
},
|
||
viewControl: {
|
||
distance: 90, // 地图视角 控制初始大小
|
||
rotateSensitivity: 0, // 旋转
|
||
zoomSensitivity: 1.5, // 缩放
|
||
},
|
||
zoom: 1.25,
|
||
},
|
||
],
|
||
animation: true,
|
||
};
|
||
|
||
myChart.setOption(option);
|
||
myChart.on("click", chartClick);
|
||
//点击地图区域事件
|
||
function chartClick(param) {
|
||
console.log(param);
|
||
myChart.setOption(option, false);
|
||
window.addEventListener("resize", function () {
|
||
myChart.resize();
|
||
});
|
||
// var selectedPro = param.name;
|
||
// if (!cityProper[selectedPro]) {
|
||
// option.series.splice(1);
|
||
// option.legend = null;
|
||
// option.visualMap = null;
|
||
// myChart.setOption(option, true);
|
||
// return;
|
||
// }
|
||
//获取点击区域数据
|
||
// $.get(cityProper[selectedPro], function (geojson) {
|
||
// echarts.registerMap(selectedPro, geojson);
|
||
// //根据需求,如果要替换青岛地图,series参数为[0],不替换为[1],其中left、top自己设置。
|
||
// option.series[0] = {
|
||
// name: "",
|
||
// type: "map",
|
||
// map: selectedPro,
|
||
// boxDepth: 80, //地图倾斜度
|
||
// regionHeight: 5, //地图厚度
|
||
// itemStyle: {
|
||
// normal: {
|
||
// label: {
|
||
// show: true,
|
||
// },
|
||
// },
|
||
// emphasis: {
|
||
// label: {
|
||
// show: true,
|
||
// },
|
||
// },
|
||
// },
|
||
// groundplane: {
|
||
// show: false,
|
||
// },
|
||
// data: data,
|
||
// shading: "realistic",
|
||
// // 真实感材质相关配置 shading: 'realistic'时有效
|
||
// realisticMaterial: {
|
||
// detailTexture: "#fff", // 纹理贴图
|
||
// textureTiling: 1, // 纹理平铺,1是拉伸,数字表示纹理平铺次数
|
||
// roughness: 0, // 材质粗糙度,0完全光滑,1完全粗糙
|
||
// metalness: 0, // 0材质是非金属 ,1金属
|
||
// roughnessAdjust: 0,
|
||
// },
|
||
// viewControl: {
|
||
// distance: 30, // 地图视角 控制初始大小
|
||
// rotateSensitivity: 1, // 旋转
|
||
// zoomSensitivity: 1, // 缩放
|
||
// },
|
||
// };
|
||
// myChart.setOption(option);
|
||
// });
|
||
}
|
||
}
|
||
);
|
||
},
|
||
},
|
||
created() {},
|
||
mounted() {
|
||
this.initMap();
|
||
},
|
||
};
|
||
</script>
|
||
<style lang="less" scoped>
|
||
.top {
|
||
background-color: red;
|
||
height: 7vh;
|
||
width: 100%;
|
||
background: url(../assets/客户侧总体用能情况分析/标题背景.png);
|
||
background-position: center center;
|
||
background-size: cover;
|
||
display: flex;
|
||
align-items: center;
|
||
background-repeat: no-repeat;
|
||
justify-content: space-between;
|
||
|
||
p {
|
||
font-size: 4vh;
|
||
font-family: " Alibaba PuHuiTi" 2, " Alibaba PuHuiTi" 20;
|
||
font-weight: 600;
|
||
line-height: 4vh;
|
||
color: #fff;
|
||
margin-right: 3vw;
|
||
}
|
||
img:nth-of-type(1) {
|
||
width: 12vw;
|
||
height: 5.4vh;
|
||
}
|
||
img:nth-of-type(2) {
|
||
width: 8.2vw;
|
||
height: 2.5vh;
|
||
}
|
||
}
|
||
.container {
|
||
width: 100%;
|
||
height: 89vh;
|
||
// background-color: yellow;
|
||
margin-top: 1vh;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
.left,
|
||
.right {
|
||
width: 22.7vw;
|
||
height: 100%;
|
||
// background-color: aqua;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-between;
|
||
}
|
||
.center {
|
||
width: 51.7vw;
|
||
height: 100%;
|
||
// background-color: blanchedalmond;
|
||
}
|
||
.left {
|
||
color: #fff;
|
||
.ztynqk {
|
||
width: 100%;
|
||
height: 27.3vh;
|
||
background-color: red;
|
||
background: url("../assets/客户侧总体用能情况分析/组 3117.png");
|
||
background-size: 100% 100%;
|
||
background-repeat: no-repeat;
|
||
position: relative;
|
||
|
||
.title {
|
||
position: absolute;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
font-size: 18px;
|
||
font-family: "Source Han Sans";
|
||
font-weight: 700;
|
||
color: rgba(255, 255, 255, 0.87);
|
||
}
|
||
|
||
.typeBox {
|
||
list-style: none;
|
||
display: flex;
|
||
position: absolute;
|
||
top: 54px;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
li {
|
||
width: 39px;
|
||
height: 21px;
|
||
background: rgba(29, 29, 29, 0.5);
|
||
border-radius: 2px 2px 2px 2px;
|
||
font-size: 14px;
|
||
border: 1px solid #666666;
|
||
text-align: center;
|
||
margin: 2.5px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.active {
|
||
background: rgba(10, 167, 255, 0.3);
|
||
border: 1px solid #0aa7ff;
|
||
}
|
||
}
|
||
|
||
.bottom {
|
||
margin-top: 90px;
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
|
||
.bottomBox {
|
||
display: flex;
|
||
align-items: center;
|
||
width: 180px;
|
||
margin: 10px;
|
||
|
||
img {
|
||
width: 72px;
|
||
height: 72px;
|
||
}
|
||
.box1 {
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: 72px;
|
||
p:nth-of-type(1) {
|
||
width: 120px;
|
||
margin-bottom: 10px;
|
||
margin-top: 5px;
|
||
font-size: 14px;
|
||
font-family: "AlibabaPuHuiTi";
|
||
font-weight: 400;
|
||
}
|
||
span:nth-of-type(1) {
|
||
font-size: 20px;
|
||
font-family: "AlibabaPuHuiTi";
|
||
font-weight: 700;
|
||
}
|
||
|
||
span:nth-of-type(2) {
|
||
font-size: 14px;
|
||
font-family: "AlibabaPuHuiTi";
|
||
font-weight: 400;
|
||
margin-left: 6px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.ssfhzs {
|
||
width: 100%;
|
||
height: 29.2vh;
|
||
background-color: yellow;
|
||
background: url("../assets/客户侧总体用能情况分析/实时负荷走势-框.png");
|
||
background-size: 100% 100%;
|
||
}
|
||
.ynl {
|
||
width: 100%;
|
||
height: 30vh;
|
||
background-color: blue;
|
||
background: url("../assets/客户侧总体用能情况分析/用能量-框.png");
|
||
background-size: 100% 100%;
|
||
}
|
||
}
|
||
.right {
|
||
.yhhyzb {
|
||
width: 100%;
|
||
height: 27.2vh;
|
||
background-color: yellow;
|
||
background: url("../assets/客户侧总体用能情况分析/组 3117.png");
|
||
background-size: 100% 100%;
|
||
}
|
||
.ynflzb {
|
||
height: 27.2vh;
|
||
background-color: red;
|
||
background: url("../assets/客户侧总体用能情况分析/组 3118.png");
|
||
background-size: 100% 100%;
|
||
}
|
||
.qyydlpm {
|
||
height: 32.7vh;
|
||
background-color: aqua;
|
||
background: url("../assets/客户侧总体用能情况分析/组 3119.png");
|
||
background-size: 100% 100%;
|
||
}
|
||
}
|
||
.center {
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-between;
|
||
position: relative;
|
||
|
||
#map {
|
||
width: 994px;
|
||
position: absolute;
|
||
height: 627px;
|
||
height: 58vh;
|
||
background: url(../assets/客户侧总体用能情况分析/背景.png);
|
||
background-size: 100% 100%;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
overflow: hidden;
|
||
}
|
||
.yhzyfbqk {
|
||
height: 30vh;
|
||
width: 100%;
|
||
background-color: yellow;
|
||
background: url("../assets/客户侧总体用能情况分析/组 3120.png");
|
||
background-size: 100% 100%;
|
||
position: absolute;
|
||
bottom: 0;
|
||
}
|
||
}
|
||
}
|
||
</style>
|