优化页面样式

main
jinna 3 years ago
parent aef46e8cbf
commit 0f88bfc672
  1. 92
      src/views/dashboard/home.vue

@ -166,7 +166,7 @@
</div>
<div class="center_bottom">
<div class="charts_box map-box">
<!-- <ShowMap :mapData="mapData"></ShowMap> -->
<!-- <ShowMap :mapData="mapData" v-if="mapData && isMap"></ShowMap> -->
<div id="chart_map" class="map_box"></div>
</div>
<div class="charts_box">
@ -450,6 +450,7 @@ export default {
return b.count - a.count;
});
});
content1[0].map((item) => {
this.pieData.push({
name: item.快递名称,
@ -460,9 +461,9 @@ export default {
this.pieData = this.pieData.sort(function (a, b) {
return b.y - a.y;
});
this.pieData[0].h = 15;
this.pieData[1].h = 10;
this.pieData[2].h = 5;
this.pieData[0].h = 10;
this.pieData[1].h = 5;
this.pieData[2].h = 2;
this.shouData.map((item, index) => {
if (index <= 10) {
this.slideList[0].arr.push({ no: index + 1, name: item.name, count: item.count });
@ -691,14 +692,14 @@ export default {
fontSize: 15,
color: "#fff",
},
top: 12,
top: 0,
},
legend: {
data: ["到件量", "派件量"],
textStyle: {
color: "#fff",
},
top: 12,
top: 0,
right: 10,
itemHeight: 8,
},
@ -844,20 +845,14 @@ export default {
legend: {
enabled: false, //
},
tooltip: {
enabled: false,
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: "pointer",
depth: 35,
// dataLabels: {
// enabled: true,
// formatter: function (params) {
// //this console.log(this)
// return `<span class="my-class" style="color:#e39054;font-size:0.16rem">${this.key}:</span>
// <span style="color:#e39054;font-size:0.14rem;">${((this.y / this.total) * 100).toFixed(2)}%</span><br />
// <span style="font-size:0.14rem;color:#fff;line-height: 0.12rem;font-family: 'FZSK';">${this.y}</span>`
// },
// },
dataLabels: {
enabled: true, //线tip
distance: "11%",
@ -896,73 +891,6 @@ export default {
],
});
},
//3d
getHeight3D(series, height) {
series.sort((a, b) => {
return b.pieData.value - a.pieData.value;
});
return (height * 25) / series[0].pieData.value;
},
getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, h) {
//
let midRatio = (startRatio + endRatio) / 2;
let startRadian = startRatio * Math.PI * 2;
let endRadian = endRatio * Math.PI * 2;
let midRadian = midRatio * Math.PI * 2;
//
if (startRatio === 0 && endRatio === 1) {
isSelected = true;
}
// / k 1/3
k = typeof k !== "undefined" ? k : 1 / 3;
// x y 0
let offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
let offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
// 1
let hoverRate = isHovered ? 1.05 : 1;
//
return {
u: {
min: -Math.PI,
max: Math.PI * 3,
step: Math.PI / 32,
},
v: {
min: 0,
max: Math.PI * 2,
step: Math.PI / 20,
},
x: (u, v) => {
if (u < startRadian) {
return offsetX + Math.cos(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
}
if (u > endRadian) {
return offsetX + Math.cos(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
}
return offsetX + Math.cos(u) * (1 + Math.cos(v) * k) * hoverRate;
},
y: (u, v) => {
if (u < startRadian) {
return offsetY + Math.sin(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
}
if (u > endRadian) {
return offsetY + Math.sin(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
}
return offsetY + Math.sin(u) * (1 + Math.cos(v) * k) * hoverRate;
},
z: (u, v) => {
if (u < -Math.PI * 0.5) {
return Math.sin(u);
}
if (u > Math.PI * 2.5) {
return Math.sin(u) * h * 0.1;
}
return Math.sin(v) > 0 ? 1 * h * 0.1 : -1;
},
};
},
//
changeData(val) {
this.active = val;

Loading…
Cancel
Save