You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

264 lines
6.1 KiB

2 years ago
<template>
<div class="mainBox">
<div class="select-nav">
<div>年份:</div>
<el-select v-model="ruleForm.date" placeholder="请选择年份" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<!-- 各区域执法计划 -->
<div class="bodyBox boxAllStyle">
<div id="execution"></div>
</div>
<div class="bottomBox">
<div class="boxAllStyle">
<completePlan></completePlan>
</div>
<div style="width: 15px"></div>
2 years ago
<div class="boxAllStyle">
<finishRate></finishRate>
</div>
</div>
</div>
</template>
<script>
import * as echarts from "echarts";
2 years ago
import completePlan from "./echarts/completePlan";
import finishRate from "./echarts/finishRate";
2 years ago
export default {
data() {
return {
ruleForm: {
date: "",
},
options: [
{
value: "选项5",
label: "2023",
2 years ago
},
{
value: "选项4",
label: "2022",
2 years ago
},
{
value: "选项3",
label: "2021",
},
{
value: "选项2",
label: "2020",
2 years ago
},
{
value: "选项1",
label: "2019",
2 years ago
},
],
};
},
components: {
2 years ago
completePlan,
finishRate,
2 years ago
},
mounted() {
this.init();
},
methods: {
init() {
var chartDom = document.getElementById("execution");
var myChart = echarts.init(chartDom);
var option = {
title: {
show: true,
text: "各区域执法计划",
textStyle: {
color: "#3D434D",
fontSize: 16,
},
left: 34,
top: 15,
},
tooltip: {
// show:false,
2 years ago
trigger: "axis",
axisPointer: {
type: "shadow",
shadowStyle: {
color: "rgba(237,240,242,0.5)",
// opacity: 0.1,
// shadowColor: "rgba(237,240,242,0.5)",
// shadowBlur: 10,
},
},
showContent: false,
},
grid: {
left: "3%",
right: "3%",
bottom: "3%",
containLabel: true,
},
xAxis: [
{
type: "category",
data: [
"苏州",
"张家港市",
"常熟市",
"太仓市",
"昆山市",
"吴江区",
"吴中区",
"姑苏区",
"相城区",
"工业园区",
"高新区",
],
axisTick: {
show: false,
},
axisLabel: {
show: true,
fontSize: '13px',
fontFamily: 'Alibaba PuHuiTi',
fontWeight: 500,
color: '#525966',
2 years ago
},
axisLine: {
lineStyle: {
color: "#B6C3D9",
},
},
z: 1000,
},
],
yAxis: [
{
splitLine :{ //网格线
lineStyle:{
type:'dashed', //设置网格线类型 dotted虚线 solid:实线
},
show:true //隐藏或显示
},
axisLabel: {
show: true,
fontSize: '13px',
fontFamily: 'Alibaba PuHuiTi',
fontWeight: 500,
color: '#525966',
},
2 years ago
},
],
series: [
{
type: "bar",
barWidth: 28,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
//只要修改前四个参数就ok
offset: 0,
color: "#FF8B02",
}, //柱图渐变色
{
offset: 1,
color: "#FFA70F",
},
]),
},
z: 100,
2 years ago
data: [700, 400, 600, 300, 580, 250, 490, 200, 390, 460, 90],
//高亮的效果
emphasis:{
label:{
show:true,
formatter: '{c}',
position: 'top',
fontSize: 14,
color: '#FF8C03',
fontWeight: 'bold',
fontFamily:'Alibaba PuHuiTi'
}
}
2 years ago
},
],
};
option && myChart.setOption(option);
},
},
};
</script>
<style lang="scss" scoped>
.boxAllStyle {
background: #ffffff;
box-shadow: 0px 1px 24px 0px #e2e2e2;
border-radius: 10px;
}
.mainBox {
height: 100%;
width: 100%;
padding: 20px;
.select-nav {
// height: 38px;
2 years ago
display: flex;
align-items: center;
margin-bottom: 15px;
& > div:nth-of-type(1) {
2 years ago
font-family: 'Alibaba PuHuiTi';
2 years ago
margin-right: 5px;
2 years ago
color: #525966;
2 years ago
}
::v-deep .el-select {
background-color: transparent;
width: 210px;
.el-input__inner {
height: 33px;
}
.el-input .el-input__suffix .el-input__suffix-inner .el-icon-arrow-up {
display: flex;
align-items: center;
justify-content: center;
}
// border-radius: 2px;
.el-input
.el-input__suffix
.el-input__suffix-inner
.el-icon-arrow-up::before {
content: "";
background: url(../../assets/images/down2.png) center center no-repeat;
background-size: cover;
position: absolute;
width: 10px;
height: 7px;
// top: 50%;
// left: 50%;
// transform: translate(-50%, -50%);
transform: rotate(180deg);
}
}
2 years ago
}
.bodyBox {
width: 100%;
height: 250px;
margin-bottom: 15px;
#execution {
width: 100%;
height: 100%;
}
}
.bottomBox {
height: calc(100% - 250px - 53px - 15px);
display: flex;
justify-content: space-between;
& > .boxAllStyle {
flex: 1;
}
}
}
</style>