手机端适配

ds1.0
fanluyan 2 years ago
parent 9739da7c49
commit 8f954d4675

@ -52,6 +52,7 @@ export default {
width: 100%; width: 100%;
height: 40px; height: 40px;
font-size: 12px; font-size: 12px;
line-height: 40px;
.logo { .logo {
display: none; display: none;
} }
@ -99,6 +100,13 @@ export default {
top: 41px; top: 41px;
// //
.stritleEchartsPage { .stritleEchartsPage {
height: 100%;
.exportDialog {
.el-dialog {
margin-top: 140px !important;
width: 80%;
}
}
.el-card .el-card__body { .el-card .el-card__body {
padding: 8px; padding: 8px;
height: calc(100% - 16px); height: calc(100% - 16px);
@ -113,13 +121,14 @@ export default {
p { p {
padding: 1.5%; padding: 1.5%;
margin: 1.5%; margin: 1.5%;
zoom: 0.8;
span { span {
font-size: 12px !important; font-size: 12px !important;
} }
} }
} }
.chartClass { .chartClass {
zoom: 0.5; height: calc(100% - 16px);
} }
.dateBox { .dateBox {
top: 8px; top: 8px;
@ -146,6 +155,28 @@ export default {
} }
} }
} }
.picSetBox {
.swiperBox {
.title {
height: 20px;
line-height: 20px;
.el-breadcrumb {
height: 20px;
line-height: 20px;
font-size: 12px;
}
}
.thumb-example {
height: calc(100% - 8px);
.picTop {
height: 70%;
}
.picBottom {
height: 30%;
}
}
}
}
.picSetBox { .picSetBox {
.parameterArea { .parameterArea {
width: 180px; width: 180px;
@ -171,12 +202,14 @@ export default {
} }
.infoDialog { .infoDialog {
.el-dialog { .el-dialog {
width: 80% !important;
margin-top: 120px !important;
} }
} }
.setTimeDialog { .setTimeDialog {
.el-dialog { .el-dialog {
width: 80% !important; width: 80% !important;
margin-top: 15vh !important; margin-top: 120px !important;
} }
} }
} }
@ -207,7 +240,7 @@ export default {
.bigpic { .bigpic {
position: relative; position: relative;
img { img {
height: auto; height: 200px;
} }
.caption { .caption {
position: absolute; position: absolute;
@ -241,7 +274,7 @@ export default {
height: auto; height: auto;
.el-dialog { .el-dialog {
width: 100% !important; width: 100% !important;
margin-top: 120px !important; margin-top: 140px !important;
} }
} }
} }

@ -1,87 +1,87 @@
<template> <template>
<div id="myMidChart" ref="pieChart" :style="boxStyle"></div> <div id="myMidChart" ref="pieChart" :style="boxStyle"></div>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
pieData: {}, pieData: {},
boxStyle: {} boxStyle: {},
},
data() {
return {};
},
mounted() {
this.$nextTick(function () {
this.drawBar();
});
},
methods: {
drawBar() {
// domecharts
var myChart = this.$echarts.init(this.$refs.pieChart);
//
myChart.setOption({
legend: {
orient: "vertical",
top: "center",
left: "right",
},
tooltip: {
trigger: "item",
},
series: [
{
// name: 'Access From',
type: "pie",
radius: ["40%", "70%"],
center: ["35%", "50%"],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: "#fff",
borderWidth: 2,
},
label: {
show: false,
position: "center",
},
emphasis: {
label: {
show: false,
fontSize: 12,
fontWeight: "bold",
},
},
labelLine: {
show: false,
},
data: this.pieData,
},
],
});
window.addEventListener("resize", () => {
// echartsresizeecharts
myChart.resize();
});
}, },
data() { },
return {}; watch: {
pieData(val, old) {
this.drawBar();
}, },
mounted() { },
this.$nextTick(function () { beforeDestroy() {
this.drawBar(); /* resize
});
},
methods: {
drawBar() {
// domecharts
var myChart = this.$echarts.init(this.$refs.pieChart);
//
myChart.setOption({
legend: {
orient: 'vertical',
top: 'center',
left: 'right'
},
tooltip: {
trigger: 'item'
},
series: [
{
// name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
center: ['35%', '50%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2
},
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.pieData
}
]
});
window.addEventListener('resize', () => {
// echartsresizeecharts
myChart.resize();
});
}
},
watch: {
pieData(val, old) {
this.drawBar();
}
},
beforeDestroy() {
/* resize
容易导致内存泄漏和额外CPU或GPU占用哦*/ 容易导致内存泄漏和额外CPU或GPU占用哦*/
window.removeEventListener('resize', () => { window.removeEventListener("resize", () => {
myChart.resize(); myChart.resize();
}); });
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
#myMidChart { #myMidChart {
width: 100%; width: 100%;
height: 240px; height: 240px;
} }
</style> </style>

@ -251,12 +251,14 @@ export default {
top: 20, top: 20,
bottom: 20, bottom: 20,
}, },
series: [ series: [
{ {
type: "pie", type: "pie",
// minAngle: 15, //
startAngle: 150, //
radius: ["40%", "70%"], radius: ["40%", "70%"],
avoidLabelOverlap: false, avoidLabelOverlap: false,
itemStyle: { itemStyle: {
borderRadius: 10, borderRadius: 10,
borderColor: "#fff", borderColor: "#fff",
@ -264,14 +266,14 @@ export default {
}, },
label: { label: {
show: true, show: true,
fontSize: 16, fontSize: 12,
fontWeight: "bold", fontWeight: "normal",
formatter: "{b}\n{d}%", formatter: "{b}\n{d}%",
}, },
emphasis: { emphasis: {
label: { label: {
show: true, show: true,
fontSize: 26, fontSize: 12,
fontWeight: "bold", fontWeight: "bold",
formatter: "{b}\n{d}%", formatter: "{b}\n{d}%",
}, },
@ -313,7 +315,7 @@ export default {
top: "10%", top: "10%",
left: "10%", left: "10%",
right: "10%", right: "10%",
bottom: "10%", bottom: "13%",
}, },
xAxis: { xAxis: {
type: "category", type: "category",
@ -413,15 +415,15 @@ export default {
}, },
label: { label: {
show: true, show: true,
fontSize: 16, fontSize: 14,
fontWeight: "bold", fontWeight: "normal",
formatter: "{b}\n{d}%", formatter: "{b}\n{d}%",
}, },
emphasis: { emphasis: {
label: { label: {
show: true, show: true,
fontSize: 26, fontSize: 14,
fontWeight: "bold", fontWeight: "normal",
formatter: "{b}\n{d}%", formatter: "{b}\n{d}%",
}, },
}, },

Loading…
Cancel
Save