This commit is contained in:
duanxiaohai 2024-06-04 14:07:22 +08:00
commit a07a4a2efe
13 changed files with 780 additions and 277 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
src/assets/ylMove.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -164,6 +164,7 @@ onMounted(() => {
display: flex;
position: absolute;
align-items: center;
z-index: 2;
}
&-left {

View File

@ -44,32 +44,6 @@ const getOption = () => {
{
type: "category",
axisLabel: {
// formatter: function (params) {
// var str = ""; //
// var paramsLen = params.length; //
// var len = 6; //
// var rowNumber = Math.ceil(paramsLen / len); //
// if (paramsLen > len) {
// //len
// for (var i = 0; i < rowNumber; i++) {
// var temp = ""; //
// var start = i * len; //
// var end = start + len; //
// if (i == rowNumber - 1) {
// //
// temp = params.substring(start, paramsLen);
// } else {
// //
// temp = params.substring(start, end) + "\n";
// }
// str += temp; //
// }
// } else {
// //
// str = params;
// }
// return str; //
// },
textStyle: {
color: "#ffffff",
fontSize: 15,
@ -116,6 +90,7 @@ const getOption = () => {
],
series: [
{
z: 1,
name: "精神病健康居家在册管理人数",
type: "bar",
data: data.rs,
@ -131,65 +106,143 @@ const getOption = () => {
itemStyle: {
normal: {
color: function (params) {
// var colorList = [
// new echarts.graphic.LinearGradient(
// 0,
// 0,
// 0,
// 1,
// [
// {
// offset: 0,
// color: "rgba(23, 237, 255, 1)",
// },
// {
// offset: 1,
// color: "rgba(23, 237, 255, 0.20)",
// },
// ],
// false
// ),
// new echarts.graphic.LinearGradient(
// 0,
// 0,
// 0,
// 1,
// [
// {
// offset: 0,
// color: "rgba(255, 243, 119, 1)",
// },
// {
// offset: 1,
// color: "rgba(255, 242, 142, 0.20)",
// },
// ],
// false
// ),
// new echarts.graphic.LinearGradient(
// 0,
// 0,
// 0,
// 1,
// [
// {
// offset: 0,
// color: "rgba(142, 187, 255, 1)",
// },
// {
// offset: 1,
// color: "rgba(142, 187, 255, 0.20)",
// },
// ],
// false
// ),
// ];
var colorList = [
new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(23, 237, 255, 1)",
},
{
offset: 1,
color: "rgba(23, 237, 255, 0.20)",
},
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .3)" },
{ offset: 1, color: "rgba(23, 237, 255, .5)" },
],
false
),
new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(255, 243, 119, 1)",
},
{
offset: 1,
color: "rgba(255, 242, 142, 0.20)",
},
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(255, 242, 142, .7)" },
{ offset: 0.5, color: "rgba(255, 242, 142, .7)" },
{ offset: 0.5, color: "rgba(255, 242, 142, .3)" },
{ offset: 1, color: "rgba(255, 242, 142, .5)" },
],
false
),
new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(142, 187, 255, 1)",
},
{
offset: 1,
color: "rgba(142, 187, 255, 0.20)",
},
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(142, 187, 255, .7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, .7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, .3)" },
{ offset: 1, color: "rgba(142, 187, 255, .5)" },
],
false
),
},
];
return colorList[params.dataIndex % colorList.length];
},
},
},
},
{
z: 1,
name: "上部1",
type: "pictorialBar",
symbolPosition: "end",
data: data.rs,
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [21, 15],
itemStyle: {
normal: {
color: function (params) {
var colorList = [
{
offset: 1,
color: "rgba(23, 237, 255, 1)",
},
{
offset: 1,
color: "rgba(255, 242, 142, 1)",
},
{
offset: 1,
color: "rgba(142, 187, 255, 1)",
},
];
return colorList[params.dataIndex % colorList.length].color;
},
},
},
// itemStyle: {
// borderColor: "#2fffa4",
// color: "rgba(142, 187, 255, 1)",
// },
},
],
};
};

View File

@ -3,7 +3,7 @@
</template>
<script setup >
import { onMounted, reactive, ref,onBeforeMount,defineProps } from "vue";
import { onMounted, reactive, ref, onBeforeMount, defineProps } from "vue";
// echarts
import * as echarts from "echarts";
const props = defineProps({
@ -11,21 +11,21 @@ const props = defineProps({
type: Array,
default: () => [],
},
year:{
year: {
type: Array,
default: () => [],
}
},
});
const data = reactive({
list: [],
year: [],
option: {},
bg: [],
});
const data= reactive({
list:[],
year:[],
option:{},
bg:[],
})
const chart = ref(); // DOM
const getOption = () => {
data.option = {
data.option = {
tooltip: {
trigger: "axis",
formatter: "{b0}<br />{a0}:{c0} ",
@ -66,8 +66,9 @@ data.option = {
{
name: "历年体检人数",
type: "value",
nameTextStyle: { // Y
fontSize: 14 // 20
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: {
show: true,
@ -123,6 +124,7 @@ data.option = {
],
series: [
{
z: 1,
name: "体检人数",
type: "bar",
data: data.list,
@ -130,7 +132,7 @@ data.option = {
label: {
show: true,
color: "#ffffff",
position:'top',
position: "top",
formatter: function (data) {
return data.value;
},
@ -138,42 +140,100 @@ data.option = {
itemStyle: {
normal: {
color: function (params) {
// var colorList = [
// new echarts.graphic.LinearGradient(
// 0,
// 0,
// 0,
// 1,
// [
// {
// offset: 0,
// color: "rgba(23, 237, 255, 1)",
// },
// {
// offset: 1,
// color: "rgba(23, 237, 255, 0.20)",
// },
// ],
// false
// ),
// new echarts.graphic.LinearGradient(
// 0,
// 0,
// 0,
// 1,
// [
// {
// offset: 0,
// color: "rgba(255, 243, 119, 1)",
// },
// {
// offset: 1,
// color: "rgba(255, 242, 142, 0.20)",
// },
// ],
// false
// ),
// new echarts.graphic.LinearGradient(
// 0,
// 0,
// 0,
// 1,
// [
// {
// offset: 0,
// color: "rgba(142, 187, 255, 1)",
// },
// {
// offset: 1,
// color: "rgba(142, 187, 255, 0.20)",
// },
// ],
// false
// ),
// ];
var colorList = [
new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(23, 237, 255, 1)",
},
{
offset: 1,
color: "rgba(23, 237, 255, 0.20)",
},
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .3)" },
{ offset: 1, color: "rgba(23, 237, 255, .5)" },
],
false),
new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(255, 243, 119, 1)",
},
{
offset: 1,
color: "rgba(255, 242, 142, 0.20)",
},
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(255, 242, 142, .7)" },
{ offset: 0.5, color: "rgba(255, 242, 142, .7)" },
{ offset: 0.5, color: "rgba(255, 242, 142, .3)" },
{ offset: 1, color: "rgba(255, 242, 142, .5)" },
],
false),
new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(142, 187, 255, 1)",
},
{
offset: 1,
color: "rgba(142, 187, 255, 0.20)",
},
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(142, 187, 255, .7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, .7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, .3)" },
{ offset: 1, color: "rgba(142, 187, 255, .5)" },
],
false),
},
];
return colorList[params.dataIndex % colorList.length];
},
},
@ -189,29 +249,66 @@ data.option = {
data: data.bg.map(() => 100),
barWidth: 50,
},
{
z: 1,
name: "上部1",
type: "pictorialBar",
symbolPosition: "end",
data: data.list,
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [23, 15],
itemStyle: {
normal: {
color: function (params) {
var colorList = [
{
offset: 1,
color: "rgba(23, 237, 255, 1)",
},
{
offset: 1,
color: "rgba(255, 242, 142, 1)",
},
{
offset: 1,
color: "rgba(142, 187, 255, 1)",
},
];
return colorList[params.dataIndex % colorList.length].color;
},
},
},
// itemStyle: {
// borderColor: "#2fffa4",
// color: "rgba(142, 187, 255, 1)",
// },
},
],
};
};
}
const setChart = () => {
// Vue3
var myChart = echarts.init(chart.value);
// 使
myChart.setOption(data.option);
}
};
onBeforeMount(() => {
setTimeout(() => {
data.list = props.list
data.year = props.year
data.year.forEach(()=>{
data.bg.push(0)
})
getOption()
setChart()
}, 600)
data.list = props.list;
data.year = props.year;
data.year.forEach(() => {
data.bg.push(0);
});
getOption();
setChart();
}, 600);
});
</script>
<style scoped>

View File

@ -126,7 +126,7 @@ const getOption = () => {
data: data.zgffrc,
symbol: "diamond",
symbolOffset: ["-20%", "-50%"],
symbolSize: [19, 10],
symbolSize: [17, 10],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(142, 187, 255, 1)",
@ -183,7 +183,7 @@ const getOption = () => {
data: data.cxffrc,
symbol: "diamond",
symbolOffset: [4, "-50%"],
symbolSize: [19, 10],
symbolSize: [17, 10],
itemStyle: {
borderColor: "#32ffee",
color: "rgba(23, 237, 255, 1)",

View File

@ -246,7 +246,7 @@ const getOption = () => {
yAxisIndex: 0,
name: "特困救助人次",
data: data.list1,
barWidth: 10,
barWidth: 15,
type: "bar",
// itemStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@ -282,7 +282,7 @@ const getOption = () => {
yAxisIndex: 0,
name: "低保救助人次",
data: data.list2,
barWidth: 10,
barWidth: 15,
type: "bar",
itemStyle: {
color: {
@ -318,7 +318,7 @@ const getOption = () => {
yAxisIndex: 0,
name: "低边救助人次",
data: data.list3,
barWidth: 10,
barWidth: 15,
type: "bar",
itemStyle: {
color: {
@ -386,8 +386,8 @@ const getOption = () => {
symbolPosition: "end",
data: data.list1,
symbol: "diamond",
symbolOffset: ["-20%", "-50%"],
symbolSize: [14, 8],
symbolOffset: ["-45%", "-50%"],
symbolSize: [16, 8],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(142, 187, 255, 1)",
@ -401,7 +401,7 @@ const getOption = () => {
data: data.list2,
symbol: "diamond",
symbolOffset: ["0", "-50%"],
symbolSize: [14, 8],
symbolSize: [16, 8],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(23, 136, 255, 1)",
@ -414,8 +414,8 @@ const getOption = () => {
symbolPosition: "end",
data: data.list3,
symbol: "diamond",
symbolOffset: [5, "-50%"],
symbolSize: [14, 8],
symbolOffset: [7.5, "-50%"],
symbolSize: [16, 8],
itemStyle: {
borderColor: "#32ffee",
color: "rgba(23, 237, 255, 1)",

View File

@ -210,18 +210,34 @@ const getOption = () => {
],
series: [
{
z: 1,
yAxisIndex: 0,
name: "计划生育人数",
data: data.list1,
barWidth: 20,
type: "bar",
label:{
show:true,
position:'inside',
color:'#ffffff',
formatter:function(data){
return data.value
}
itemStyle: {
color: {
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(142, 187, 255, .7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, .7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, .3)" },
{ offset: 1, color: "rgba(142, 187, 255, .5)" },
],
},
},
label: {
show: true,
position: "inside",
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
},
{
@ -229,13 +245,13 @@ const getOption = () => {
name: "计划生育补贴金额",
data: data.list2,
type: "line", //线
label:{
show:true,
position:'top',
color:'#ffffff',
formatter:function(data){
return data.value
}
label: {
show: true,
position: "top",
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
itemStyle: {
borderColor: "#00FCFF",
@ -274,6 +290,21 @@ const getOption = () => {
},
type: "bar",
},
//
{
z: 1,
name: "上部1",
type: "pictorialBar",
symbolPosition: "end",
data: data.list1,
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [22, 15],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(142, 187, 255, 1)",
},
},
],
};
};

View File

@ -0,0 +1,293 @@
<template>
<div ref="chart" style="width: 340px; height: 250px"></div>
</template>
<script setup>
import { onMounted, reactive, ref } from "vue";
// echarts
import * as echarts from "echarts";
const chart = ref(); // DOM
const data = [120, 200, 150, 80, 70];
const lineData = [150, 230, 224, 218, 135];
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: "rgba(142, 187, 255, 1)",
},
{
offset: 0.5,
color: "rgba(142, 187, 255, 0.5)",
},
{
offset: 1,
color: "rgba(142, 187, 255, 0.20)",
},
],
},
];
const option = {
color,
tooltip: {
trigger: "axis",
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
axisPointer: {},
},
legend: {
data: ["上门服务时长", "上门服务次数"],
// top: "8%",
textStyle: {
fontSize: 16,
color: "#ffffff",
},
},
grid: {
top: "18%",
left: "3%",
right: "6%",
bottom: "0%",
containLabel: true,
color: "#ffffff",
fontSize: 16,
},
calculable: true,
xAxis: [
{
type: "category",
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
axisTick: {
show: false, //
},
data: ["4.07", "4.08", "4.09", "4.10", "4.11"],
},
{
type: "category",
show: false,
data: ["4.07", "4.08", "4.09", "4.10", "4.11"],
},
],
yAxis: [
{
type: "value",
scale: true,
name: "时长/小时",
splitLine: {
show: false,
lineStyle: {
color: "rgba(255, 255, 255, 0.3)",
fontSize: 16,
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
},
},
},
{
type: "value",
scale: true,
name: "次数/次",
min: 0,
splitLine: {
//线
show: false,
lineStyle: {
color: "rgba(255, 255, 255, 0.3)",
width: 1,
fontSize: 16,
},
},
axisLabel: {
//y
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
},
},
},
{
type: "value",
max: 100,
splitLine: {
show: false,
lineStyle: {
type: "solid",
color: "rgba(255, 255, 255, 0.3)",
},
},
axisLine: {
show: false,
lineStyle: {
type: "dotted",
},
},
axisLabel: {
show: false,
fontSize: 16,
color: "#ffffff",
lineHeight: 19,
fontFamily: "MicrosoftYaHei",
},
},
],
series: [
{
z: 1,
yAxisIndex: 0,
name: "上门服务时长",
data: data,
barWidth: 20,
type: "bar",
itemStyle: {
color: {
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(142, 187, 255, .7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, .7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, .3)" },
{ offset: 1, color: "rgba(142, 187, 255, .5)" },
],
},
},
label: {
show: true,
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
},
{
yAxisIndex: 1,
name: "上门服务次数",
data: lineData,
type: "line", //线
label: {
show: true,
position: "top",
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
itemStyle: {
borderColor: "#00FCFF",
borderWidth: 1,
color: "#00FCFF",
},
},
{
xAxisIndex: 1,
yAxisIndex: 2,
itemStyle: {
color: "rgba(180, 180, 180, 0.2)", //
},
data: data.map(() => 100),
barWidth: 40, //
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",
},
//
{
z: 1,
name: "上部1",
type: "pictorialBar",
symbolPosition: "end",
data: data,
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [22, 15],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(142, 187, 255, 1)",
},
},
],
};
// 使
onMounted(() => {
// domecharts
// var myChart = echarts.init(document.getElementById('main'));
// Vue3
var myChart = echarts.init(chart.value);
// init(); // vue3.2this
// 使
myChart.setOption(option);
// :
// window.addEventListener("resize", () => {
// myChart.resize();
// });
});
</script>
<style scoped></style>

View File

@ -177,6 +177,7 @@
>
<div>{{ data.employmentService.jypx }}</div>
<div>就业培训</div>
<div class="moveImg"></div>
</div>
<div
class="left_3_1_item"
@ -184,6 +185,7 @@
>
<div>{{ data.employmentService.jyjxfw }}</div>
<div>就业见习服务</div>
<div class="moveImg"></div>
</div>
<div
class="left_3_1_item"
@ -191,6 +193,7 @@
>
<div>{{ data.employmentService.jyyz }}</div>
<div>就业援助</div>
<div class="moveImg"></div>
</div>
</div>
</div>
@ -198,6 +201,11 @@
<div class="displayFlex center_bg">
<div class="flex1">
<div class="people_total">
<img
src="../assets/images/sy/主页人口.gif"
style="width:70%;height:112%; margin: -2% 15%;"
alt=""
>
<div class="people_total_item left">
<div class="number">{{ data.PopulationData.man }}</div>
<img
@ -2021,20 +2029,29 @@ onBeforeMount(async () => {
//
.left_3_1 {
width: 94%;
margin-top: 15px;
margin-top: 40px;
display: flex;
justify-content: space-around;
&_item {
box-sizing: border-box;
width: 160px;
height: 133px;
height: 112px;
background-image: url(@/assets/images/sy/jyfw.png);
background-repeat: no-repeat;
background-size: 100% 100%;
text-align: center;
padding-top: 22px;
position: relative;
.moveImg {
position: absolute;
width: 160px;
height: 140px;
bottom: 18px;
background-image: url(@/assets/images/sy/jyfwM.png);
background-repeat: no-repeat;
background-size: 100% 100%;
animation: example 3s infinite linear;
}
@keyframes example {
0% {
@ -2559,7 +2576,7 @@ table {
width: 146px;
height: 104px;
position: absolute;
left: -38px;
left: -40px;
top: -31px;
}
span {
@ -2609,7 +2626,7 @@ table {
width: 146px;
height: 104px;
position: absolute;
left: -38px;
left: -40px;
top: -31px;
}
span {

View File

@ -150,6 +150,7 @@
</div>
</div>
<div class="minTopPart">
<div class="moveImg"></div>
<div class="mtpImg1"></div>
<div class="mtpImg2"></div>
<div class="mtpImg3"></div>
@ -1044,6 +1045,16 @@ const getData = async () => {
margin-top: 10px;
position: relative;
.moveImg{
position: absolute;
background-image: url(@/assets/ylMove.gif);
background-repeat: no-repeat;
background-size: 100% 100%;
left: 170px;
width: 190px;
height: 173px;
}
.mtpImg1 {
width: 140px;
height: 24px;