This commit is contained in:
duanxiaohai 2024-04-15 15:58:19 +08:00
parent 9c3fb010a9
commit 3fb3c1346d
3 changed files with 114 additions and 185 deletions

View File

@ -9,13 +9,40 @@ import * as echarts from "echarts";
const chart = ref(); // DOM
let option = {
const data = [120, 200, 150, 80, 70, 110, 130];
const lineData = [150, 230, 224, 218, 135, 147, 260];
const max = data.concat(lineData).reduce((pre, cur) => (pre > cur ? pre : cur), 0); //
//
const color = [
{
type: "linear",
x: 0,
x2: 0,
y: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#40BDF7",
},
{
offset: 0.5,
color: "#40BDF7",
},
{
offset: 1,
color: "#3F82F7",
},
],
},
];
const option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
label: {
backgroundColor: "#ff0000", //
backgroundColor: "#3F82F7", //
},
},
},
@ -30,69 +57,79 @@ let option = {
color: "#ffffff",
},
calculable: true,
color: "rgba(0, 252, 255, 1)",
// color: "rgba(0, 252, 255, 1)",
color,
xAxis: [
{
// type: "category",
// scale: true,
type: "category",
// name: "/",
data: ["2019", "2020", "2021", "2022", "2023"],
},
{
type: "category",
show: false,
data: ["2019", "2020", "2021", "2022", "2023"],
},
],
yAxis: [
{
type: "value",
scale: true,
name: "计划生育人数",
color: "rgba(255, 252, 0, 1)",
max: max,
},
{
type: "value",
scale: true,
name: "计划生育补贴金额/元",
position: "right",
max: 1200,
min: 0,
boundaryGap: [0.2, 0.2]
// alignTicks: true,
// offset: 80,
// axisLine: {
// show: true,
// lineStyle: {
// color: colors[1]
// }
// },
// axisLabel: {
// formatter: '{value} ml'
// }
max: max,
// max: 300,
// position: "right",
// boundaryGap: [0.2, 0.2]
},
],
series: [
{
name: "计划生育人数",
data: data,
barWidth: 20,
type: "bar",
data: [2.0, 4.9, 7.0, 23.2, 25.6],
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#83bff6" },
{ offset: 0.5, color: "#188df0" },
{ offset: 1, color: "#188df0" },
]),
}, //
},
{
name: "计划生育补贴金额",
data: lineData,
type: "line", //线
data: [2.6, 5.9, 9.0, 16.4, 28.7],
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
{
xAxisIndex: 1,
itemStyle: {
color: "rgba(180, 180, 180, 0.2)", //
},
data: data.map(() => max),
barWidth: 60, //
emphasis: {
itemStyle: {
color: {
type: "linear",
x: 0,
x2: 0,
y: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(64, 247, 176, 0.25)",
},
{
offset: 1,
color: "rgba(17, 34, 64, 0.25)",
},
],
},
},
},
type: "bar",
},
],
};

View File

@ -1,5 +1,5 @@
<template>
<div ref="chart" style="width: 100%; height: 220px"></div>
<div ref="chart" style="width: 100%; height: 180px"></div>
</template>
<script setup>
@ -7,21 +7,16 @@ import { onMounted, reactive, ref } from "vue";
// echarts
import * as echarts from "echarts";
const chart = ref(); // DOM
const chart = ref(null); // DOM
let option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
label: {
backgroundColor: "#ff0000", //
},
},
},
legend: {
data: ["计划生育人数", "计划生育补贴金额"],
},
grid: {
left: "3%",
@ -32,75 +27,29 @@ let option = {
},
calculable: true,
color: "rgba(0, 252, 255, 1)",
xAxis: [
// {
// // type: "category",
// // scale: true,
// // name: "/",
// },
{
type: "value",
scale: true,
name: "计划生育人数",
color: "rgba(255, 252, 0, 1)",
},
{
type: "value",
scale: true,
name: "计划生育补贴金额/元",
position: "right",
max: 1200,
min: 0,
boundaryGap: [0.2, 0.2]
// alignTicks: true,
// offset: 80,
// axisLine: {
// show: true,
// lineStyle: {
// color: colors[1]
// }
// },
// axisLabel: {
// formatter: '{value} ml'
// }
},
],
xAxis: {},
yAxis: {
type: 'category',
data: ["2019", "2020", "2021", "2022", "2023"],
}
,
type: "category",
data: ["大街乡", "社阳乡", "沐尘畲族乡", "庙下乡", "溪口镇", "罗家乡"],
},
series: [
{
name: "计划生育人数",
// name: "",
type: "bar",
data: [2.0, 4.9, 7.0, 23.2, 25.6],
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
data: [2, 4, 7, 23, 25, 250],
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "rgba(26,255,217,0)" },
{ offset: 0.5, color: "#00B7FF" },
{ offset: 1, color: "#00B7FF" },
]), //
borderRadius: [0, 0, 50, 0],
},
},
{
name: "计划生育补贴金额",
type: "line", //线
data: [2.6, 5.9, 9.0, 16.4, 28.7],
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "rgba(26,255,217,0)" },
// { offset: 0.5, color: "#00B7FF" },
{ offset: 1, color: "#00B7FF" },
]), //
// borderColor: "#00B7FF", //
// borderWidth: 5,
borderRadius: [0, 0, 50, 0],
},
},
},
}
],
};

View File

@ -41,36 +41,7 @@
<div class="yd_title familyPlanning">
<!-- <span class="text">计划生育</span> -->
</div>
<!-- <div class="visitLog">
<div class="visitLog_item">
<img src="../assets/img_02.png" width="48px" height="51px" alt="" />
<div class="visitLog_item_box">
<h4>故居走访</h4>
<p>走访人员陈思思</p>
<p>走访时间2023-03-19 09:00:03</p>
</div>
<span class="check">点击查看</span>
</div>
<div class="visitLog_item">
<img src="../assets/img_02.png" width="48px" height="51px" alt="" />
<div class="visitLog_item_box">
<h4>节日走访</h4>
<p>走访人员陈思思</p>
<p>走访时间2023-03-19 09:00:03</p>
</div>
<span class="check">点击查看</span>
</div>
<div class="visitLog_item">
<img src="../assets/img_02.png" width="48px" height="51px" alt="" />
<div class="visitLog_item_box">
<h4>新年走访</h4>
<p>走访人员陈思思</p>
<p>走访时间2023-03-19 09:00:03</p>
</div>
<span class="check">点击查看</span>
</div>
</div> -->
<div style="width: 490px; height: 400px">
<div style="width: 100%; height: 400px">
<ylJHSY></ylJHSY>
</div>
</div>
@ -81,12 +52,6 @@
<!-- <span class="text">养老机构</span> -->
</div>
<div class="history">
<!-- <p>2002年至2009年担任浙江大学计算机学院和软件学院院长</p>
<p>1984年获得浙江大学计算机应用专业硕士学位之后留校任教</p>
<p>1990年获得浙江大学计算机应用专业博士学位</p>
<p>1994年至1996年担任浙江大学计算机系副系主任</p>
<p>1997年至2002年担任浙江大学计算机系系主任</p>
<p>2002年至2009年担任浙江大学计算机学院和软件学院院长</p> -->
<div class="history1">
<div>
<span>16<span class="unit"></span></span>
@ -118,7 +83,7 @@
<div class="serviceTop">
<div class="visit">
<img class="serviceimg" src="@/assets/YLimg/ylimg8.png" alt="" />
<div style="width: 290px">
<div style="width: 290px;height: 220px">
<ylSMFW></ylSMFW>
</div>
</div>
@ -136,7 +101,7 @@
src="@/assets/YLimg/ylimg7.png"
alt=""
/>
<div style="width: 490px">
<div style="width: 490px;height: 220px">
<ylXZZC></ylXZZC>
</div>
</div>
@ -158,13 +123,15 @@ import ePie3d from "./echarts/pie3d.vue";
import ylJHSY from "./echarts/ylJHSY.vue";
import ylSMFW from "./echarts/ylSMFW.vue";
import ylXZZC from "./echarts/ylXZZC.vue";
</script>
<style lang="scss" scoped>
.displayFlex {
display: flex;
flex-direction: column;
flex: 1;
// flex: 1;
width: 33.333333333%;
}
.flex1 {
flex: 1;
@ -202,16 +169,23 @@ import ylXZZC from "./echarts/ylXZZC.vue";
}
.familyPlanning {
background-image: url(@/assets/YLTitle/titleImg9.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.mechanism {
background-image: url(@/assets/YLTitle/titleImg10.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.service {
background-image: url(@/assets/YLTitle/titleImg11.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.serviceBox {
display: flex;
flex-direction: column;
box-sizing: border-box;
.serviceimg {
width: 182px;
@ -220,6 +194,13 @@ import ylXZZC from "./echarts/ylXZZC.vue";
.serviceTop {
display: flex;
justify-content: space-between;
padding: 20px 20px 0px 20px ;
box-sizing: border-box;
.visit {
display: flex;
flex-direction: column;
align-items: center;
}
.medicalService {
display: flex;
flex-direction: column;
@ -325,49 +306,11 @@ import ylXZZC from "./echarts/ylXZZC.vue";
}
}
.visitLog {
.visitLog_item {
display: flex;
align-items: center;
background-image: url(@/assets/img_12.png);
background-size: 100% 100%;
margin-top: 16px;
padding: 15px 8px;
box-sizing: border-box;
img {
display: inline-block;
margin-right: 10px;
}
.visitLog_item_box {
flex: auto;
h4 {
font-size: 18px;
font-family: MicrosoftYaHei;
font-weight: bold;
color: #0096ff;
margin-bottom: 2px;
}
p {
font-size: 12px;
font-family: SourceHanSansCN;
font-weight: 400;
color: #ffffff;
margin-top: 6px;
}
}
.check {
font-size: 12px;
font-family: SourceHanSansCN;
font-weight: 400;
color: #0096ff;
line-height: 20px;
}
}
}
.history {
padding-top: 12px;
display: flex;
justify-content: space-around;
.history1 {
font-size: 26px;
color: #ffffff;