This commit is contained in:
duanxiaohai 2024-10-16 09:41:41 +08:00
parent b6657cbe1a
commit f5ce5856bd
16 changed files with 2525 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -0,0 +1,248 @@
<template>
<div ref="chart" style="width: 100%; height: 350px"></div>
</template>
<script setup>
import {
onMounted,
reactive,
ref,
onBeforeMount,
defineProps,
watch,
} from "vue";
// echarts
import * as echarts from "echarts";
const props = defineProps({
list: {
type: Array,
default: () => [],
},
list2: {
type: Array,
default: () => [],
},
year: {
type: Array,
default: () => [],
},
});
const data = reactive({
list: [],
list2: [],
year: [],
option: {},
bg: [],
});
const chart = ref(); // DOM
const getOption = () => {
data.option = {
tooltip: {
trigger: "axis",
padding: [20, 10, 20, 10],
formatter: "{b0}<br />{a1}:{c1}<br /> ",
},
// legend: {
// data: ["尿", ""],
// top: "6%",
// right: "11%",
// textStyle: {
// fontSize: 16,
// color: "#ffffff",
// },
// },
grid: {
top: "25%",
left: "1%",
right: "10%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
// boundaryGap: false,
data: data.year,
// splitArea: {
// show: true,
// interval: '10',
// areaStyle: {
// color: ["rgba(255, 255, 255, 0.10)"],
// width:10,
// },
// },
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
},
yAxis: {
type: "value",
splitLine: {
show: true,
lineStyle: {
color: "rgba(226, 226, 226, 0.3)",
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
},
series: [
{
name: "背景",
type: "bar",
data: data.bg,
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
},
{
name: "出生人数",
type: "line",
stack: "Total",
symbol: "emptyCircle",
smooth: true,
symbolSize: 10,
itemStyle: {
borderColor: "#E8FF00",
borderWidth: 1,
color: "#E8FF00",
},
label: {
show: true,
color: "#ffffff",
position: "top",
formatter: function (data) {
return data.value;
},
},
areaStyle: {
color: "#F4F65B",
normal: {
//线4x0,y0,x2,y2(0~1);true
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
// color: 'RGBA(184, 204, 241, 1)'
color: "rgba(255, 234, 90, 0.50)",
},
{
offset: 1,
color: "rgba(255, 234, 90, 0)",
},
],
false
),
shadowBlur: 0, //shadowBlurshadowColor,shadowOffsetX/Y,
},
},
data: data.list,
},
// {
// name: "",
// type: "line",
// stack: "Total",
// symbol: "emptyCircle",
// smooth: true,
// symbolSize: 10,
// itemStyle: {
// borderColor: "#00FCFF",
// borderWidth: 1,
// color: "#00FCFF",
// },
// label: {
// show: true,
// color: "#ffffff",
// position: "top",
// formatter: function (data) {
// return data.value;
// },
// },
// areaStyle: {
// color: "#F4F65B",
// normal: {
// //线4x0,y0,x2,y2(0~1);true
// color: new echarts.graphic.LinearGradient(
// 0,
// 0,
// 0,
// 1,
// [
// {
// offset: 0,
// // color: 'RGBA(184, 204, 241, 1)'
// color: "rgba(0, 252, 255, 0.50)",
// },
// {
// offset: 1,
// color: "rgba(0, 252, 255, 0)",
// },
// ],
// false
// ),
// shadowBlur: 0, //shadowBlurshadowColor,shadowOffsetX/Y,
// },
// },
// data: data.list2,
// },
],
};
};
watch(
() => props.list,
(newValue, oldValue) => {
setTimeout(() => {
data.list = props.list;
data.list2 = props.list2;
data.year = props.year;
data.year.forEach(() => {
data.bg.push(0);
});
getOption();
setChart();
}, 600);
}
);
const setChart = () => {
// Vue3
var myChart = echarts.init(chart.value);
// 使
myChart.setOption(data.option);
};
onBeforeMount(() => {
setTimeout(() => {
data.list = props.list;
data.list2 = props.list2;
data.year = props.year;
data.year.forEach(() => {
data.bg.push(0);
});
console.log(data.bg);
getOption();
setChart();
}, 600);
});
</script>
<style scoped></style>

View File

@ -0,0 +1,236 @@
<template>
<div ref="chart" style="width: 100%; height: 330px"></div>
</template>
<script setup>
import { onMounted, reactive, ref, onBeforeMount, defineProps } from "vue";
// echarts
import * as echarts from "echarts";
const props = defineProps({
list: {
type: Array,
default: () => [],
},
year: {
type: Array,
default: () => [],
},
});
const data = reactive({
list: [],
year: [],
option: {},
bg: [],
});
//
var rich = {
name: {
color: "#666666",
fontSize: 14,
padding: [8, 30, 0, 30],
fontWeight: "400",
align: "left",
},
value: {
color: "#333",
fontSize: 15,
padding: [0, 30, 8, 30],
fontWeight: "500",
align: "left",
},
percent: {
color: "#FFF",
align: "right",
fontSize: 15,
fontWeight: "500",
//padding: [0, 5]
},
hr: {
borderColor: "#DFDFDF",
width: "100%",
borderWidth: 1,
height: 0,
},
cir: {
fontSize: 26,
},
};
var colorList = ["#3BAEFF", "#41EDD5", "#FFC371", "#797AFF"];
const chart = ref(); // DOM
const getOption = () => {
data.option = {
legend: {
show: true,
width: "80%",
top: "5%",
textStyle: {
inside: true,
color: "#9FC3E7",
padding: [14, 0, 10, 0],
align: "left",
verticalAlign: "center",
fontSize: 14,
rich: {},
},
// icon: "rect",
itemGap: 10,
itemWidth: 12,
itemHeight: 12,
// bottom: '15%'
},
tooltip: {
trigger: "item",
},
series: [
{
itemStyle: {
normal: {
color: function (params) {
return colorList[params.dataIndex];
},
},
},
type: "pie",
radius: ["20%", "50%"],
center: ["50%", "50%"],
label: {
//
show: true,
//
position: "outside",
//
// alignTo: "labelLine",
//
backgroundColor: "transparent",
//
height: 0,
//
width: 0,
//
lineHeight: 0,
// 线
distanceToLabelLine: 0,
//
borderRadius: 3,
//
borderWidth: 1,
//
borderColor: "auto",
//
padding: [3, -3, 3, -3],
//
formatter: function (params) {
return `{b|${params.value}%}{a|${params.name}}`;
},
//
rich: {
// a
a: {
//
padding: [-14, 10, 40, -70],
//
fontSize: "12px",
//
fontFamily: "MicrosoftYaHei",
//
color: "#fff",
},
// b
b: {
//
padding: [0, 10, 55, -70],
//
fontSize: "15px",
//
fontFamily: "MicrosoftYaHei-Bold, MicrosoftYaHei",
//
fontWeight: "bold",
//
color: "#fff",
},
},
},
// label: {
// textStyle: {
// color: "white", //
// fontSize: 18, //
// },
// formatter: "{b}:{c}" + "\n\n",
// borderWidth: 20,
// borderRadius: 4,
// padding: [0, -80],
// },
labelLine: {
normal: {
length: 40, // 线
length2: 40,
// lineStyle: {
// color: "white", // 线
// },
},
},
data: [
{ name: "男", value: 300 },
{ name: "女", value: 200 },
],
},
{
name: "外边框",
type: "pie",
tooltip: {
show: false,
},
clockWise: false, //
hoverAnimation: false, //
center: ["50%", "50%"], //
radius: ["52%", "52%"], //30%60%
label: {
normal: {
show: false, //datavaluename
},
},
data: [
{
value: 1, //
name: "", //label
itemStyle: {
//
normal: {
borderWidth: 20, //
// borderColor: colorList, //
borderColor: "rgba(94, 183, 249, 0.13)", //
},
},
},
],
},
],
};
};
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);
});
</script>
<style scoped></style>

View File

@ -0,0 +1,620 @@
<template>
<div ref="chart" style="width: 100%; height: 100%"></div>
</template>
<script setup>
import { onMounted, onBeforeMount, reactive, ref } from "vue";
// echarts
import * as echarts from "echarts";
const emit = defineEmits(["shuju"]);
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
});
const chart = ref(); // DOM
const colors = [
{
left: "rgba(234, 162, 57, .16)",
right: "rgba(234, 162, 57, .6)",
top: "rgba(234, 162, 57, 1)",
bottom: "rgba(234, 162, 57, .46)",
front: "rgba(234, 162, 57, .66)",
},
{
left: "rgba(14, 252, 255, .16)",
right: "rgba(14, 252, 255, .6)",
top: "rgba(14, 252, 255, 1)",
bottom: "rgba(14, 252, 255, .46)",
front: "rgba(14, 252, 255, .66)",
},
];
// const valueList = [20, 53, 47, 65, 29, 11, 10];
const data = reactive({
list: [],
option: {},
Max: 20000,
valueList: [4504, 16086, 6130, 2844, 4967, 179, 1685, 5010],
valueList2: [1181, 2177, 3720, 3711, 4642, 1654, 3395, 5552],
xxname: ["2020", "2021", "2022", "2023"],
});
// 5:
//c0:c1,c2:c3
// -ok rgba(103, 180, 233, 0.04)
const CubeLeft_1 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
// canvasshapecustom
const xAxisPoint = shape.xAxisPoint;
const c0 = [shape.x - 40, shape.y];
const c1 = [shape.x - 27, shape.y - 14];
const c2 = [xAxisPoint[0] - 27, xAxisPoint[1] - 14];
const c3 = [xAxisPoint[0] - 40, xAxisPoint[1]];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
const CubeFront_1 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
// canvasshapecustom
const xAxisPoint = shape.xAxisPoint;
const c0 = [shape.x - 40, shape.y];
const c1 = [shape.x - 18, shape.y];
const c2 = [xAxisPoint[0] - 18, xAxisPoint[1]];
const c3 = [xAxisPoint[0] - 40, xAxisPoint[1]];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
const CubeRight_1 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
const xAxisPoint = shape.xAxisPoint;
const c0 = [shape.x - 18, shape.y];
const c1 = [shape.x - 5, shape.y - 14];
const c2 = [xAxisPoint[0] - 5, xAxisPoint[1] - 14];
const c3 = [xAxisPoint[0] - 18, xAxisPoint[1]];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
const CubeTop_1 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
const c0 = [shape.x - 40, shape.y];
const c1 = [shape.x - 18, shape.y];
const c2 = [shape.x - 5, shape.y - 14];
const c3 = [shape.x - 27, shape.y - 14];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
const CubeBottom_1 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
// canvasshapecustom
const xAxisPoint = shape.xAxisPoint;
const c0 = [xAxisPoint[0] - 40, xAxisPoint[1]];
const c1 = [xAxisPoint[0] - 18, xAxisPoint[1]];
const c2 = [xAxisPoint[0] - 5, xAxisPoint[1] - 14];
const c3 = [xAxisPoint[0] - 27, xAxisPoint[1] - 14];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
echarts.graphic.registerShape("CubeLeft_1", CubeLeft_1);
echarts.graphic.registerShape("CubeFront_1", CubeFront_1);
echarts.graphic.registerShape("CubeRight_1", CubeRight_1);
echarts.graphic.registerShape("CubeTop_1", CubeTop_1);
echarts.graphic.registerShape("CubeBottom_1", CubeBottom_1);
// -------------------------
const CubeLeft_2 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
// canvasshapecustom
const xAxisPoint = shape.xAxisPoint;
const c0 = [shape.x - 0, shape.y];
const c1 = [shape.x + 13, shape.y - 14];
const c2 = [xAxisPoint[0] + 13, xAxisPoint[1] - 14];
const c3 = [xAxisPoint[0] - 0, xAxisPoint[1]];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
const CubeFront_2 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
// canvasshapecustom
const xAxisPoint = shape.xAxisPoint;
const c0 = [shape.x - 0, shape.y];
const c1 = [shape.x + 22, shape.y];
const c2 = [xAxisPoint[0] + 22, xAxisPoint[1]];
const c3 = [xAxisPoint[0] - 0, xAxisPoint[1]];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
const CubeRight_2 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
const xAxisPoint = shape.xAxisPoint;
const c0 = [shape.x + 22, shape.y];
const c1 = [shape.x + 35, shape.y - 14];
const c2 = [xAxisPoint[0] + 35, xAxisPoint[1] - 14];
const c3 = [xAxisPoint[0] + 22, xAxisPoint[1]];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
const CubeTop_2 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
const c0 = [shape.x - 0, shape.y];
const c1 = [shape.x + 22, shape.y];
const c2 = [shape.x + 35, shape.y - 14];
const c3 = [shape.x + 13, shape.y - 14];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
const CubeBottom_2 = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
// canvasshapecustom
const xAxisPoint = shape.xAxisPoint;
const c0 = [xAxisPoint[0] - 0, xAxisPoint[1]];
const c1 = [xAxisPoint[0] + 22, xAxisPoint[1]];
const c2 = [xAxisPoint[0] + 35, xAxisPoint[1] - 14];
const c3 = [xAxisPoint[0] + 13, xAxisPoint[1] - 14];
ctx
.moveTo(c0[0], c0[1])
.lineTo(c1[0], c1[1])
.lineTo(c2[0], c2[1])
.lineTo(c3[0], c3[1])
.closePath();
},
});
echarts.graphic.registerShape("CubeLeft_2", CubeLeft_2);
echarts.graphic.registerShape("CubeFront_2", CubeFront_2);
echarts.graphic.registerShape("CubeRight_2", CubeRight_2);
echarts.graphic.registerShape("CubeTop_2", CubeTop_2);
echarts.graphic.registerShape("CubeBottom_2", CubeBottom_2);
// ------------------------------
const getOption = () => {
data.option = {
legend: {
data: [
"适龄生育妇女",
"育龄妇女",
],
top: "0%",
right: "30%",
textStyle: {
fontSize: 16,
color: "#ffffff",
},
},
tooltip: {
trigger: "axis",
formatter: "{b0}:</br>{a0}:{c0}</br>{a1}:{c1}",
},
grid: {
left: 0,
right: 0,
bottom: 10,
top: 40,
containLabel: true,
},
xAxis: [
{
type: "category",
data: data.xxname,
axisLine: {
show: false,
},
offset: 10,
axisTick: {
show: false,
},
axisLabel: {
show: true,
color: "#fff",
fontSize: 16,
formatter: function (value) {
return value.length > 3 ? value.slice(0, 2) + "..." : value;
},
},
},
{
type: "category",
data: data.xxname,
axisLine: {
show: false,
},
offset: 10,
axisTick: {
show: false,
},
axisLabel: {
show: false,
color: "#fff",
fontSize: 16,
},
},
],
yAxis: {
min: 0,
max: data.Max,
// interval: 100,
type: "value",
axisLine: {
show: true,
lineStyle: {
color: "rgba(255, 255, 255, .16)",
},
},
splitLine: {
show: true,
lineStyle: {
type: "dashed",
color: "rgba(255, 255, 255, .16)",
},
},
axisTick: {
show: false,
},
axisLabel: {
show: true,
fontSize: 16,
color: "#fff",
},
},
series: [
{
xAxisIndex: 0,
name: "适龄生育妇女",
type: "custom",
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
type: "group",
children: [
{
type: "CubeBottom_1",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[0]["bottom"],
},
},
{
type: "CubeLeft_1",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[0]["left"],
},
},
{
type: "CubeFront_1",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[0]["front"],
},
},
{
type: "CubeRight_1",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[0]["right"],
},
},
{
type: "CubeTop_1",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[0]["top"],
},
},
],
};
},
//
itemStyle: {
show: true,
color: {
type: "linear",
colorStops: [{ offset: 1, color: "rgba(234, 162, 57, 1)" }],
},
},
data: data.valueList,
},
{
xAxisIndex: 0,
name: "育龄妇女",
type: "custom",
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
type: "group",
children: [
{
type: "CubeBottom_2",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[1]["bottom"],
},
},
{
type: "CubeLeft_2",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[1]["left"],
},
},
{
type: "CubeFront_2",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[1]["front"],
},
},
{
type: "CubeRight_2",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[1]["right"],
},
},
{
type: "CubeTop_2",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: colors[1]["top"],
},
},
],
};
},
//
itemStyle: {
show: true,
color: {
type: "linear",
colorStops: [{ offset: 1, color: "rgba(14, 252, 255, 1)" }],
},
},
data: data.valueList2,
},
//
{
type: "bar",
xAxisIndex: 1,
label: {
show: true,
fontSize: 18,
position: "top",
color: "#ffffff",
formatter: function (data) {
return data.value - 5;
},
},
itemStyle: {
color: "rgba(221, 242, 255, 0)",
},
data: data.valueList.map((item) => parseInt(item) + 5),
barWidth: 30,
},
{
type: "bar",
xAxisIndex: 1,
label: {
show: true,
fontSize: 18,
position: "top",
color: "#ffffff",
formatter: function (data) {
return data.value - 5;
},
},
itemStyle: {
color: "rgba(221, 242, 255, 0)",
},
data: data.valueList2.map((item) => parseInt(item) + 5),
barWidth: 20,
},
],
};
};
const setChart = () => {
var myChart = echarts.init(chart.value);
myChart.setOption(data.option);
myChart.on("click", function (params) {
emit("shuju", params.name, params.seriesIndex);
});
};
const getMaxCeilingValue = (arr) => {
let max = Math.max(...arr); //
return Math.ceil(max / 100) * 100; // 100
};
const setChart1 = () => {
data.valueList = [];
data.xxname = [];
if (data.list.length !== 0) {
data.list.forEach((item) => {
data.xxname.push(item.name); //
data.valueList.push(item.num); //
});
}
};
onBeforeMount(() => {
setTimeout(() => {
data.xxname.forEach((item, index) => {
props.list.forEach((itemm, indexx) => {
if (item == itemm.xzjd) {
data.valueList[index] = itemm.qrrs;
data.valueList2[index] = itemm.qcrs;
}
});
});
getOption();
setChart();
}, 800);
});
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,272 @@
<template>
<div ref="chart" style="width: 100%; height: 90%"></div>
</template>
<script setup >
import { onMounted, reactive, ref, onBeforeMount, defineProps } from "vue";
// echarts
import * as echarts from "echarts";
const props = defineProps({
list: {
type: Array,
default: () => [],
},
year: {
type: Array,
default: () => [],
},
});
const data = reactive({
list: [],
zgffrc: [], //
cxffrc: [], //
year: [],
option: {},
bg: [],
});
const chart = ref(); // DOM
const getOption = () => {
data.option = {
tooltip: {
trigger: "axis",
formatter: "{b0}<br />{a1}:{c1} <br />{a3}:{c3} ",
},
legend: {
data: ["育龄妇女", "婴幼儿"],
top: "6%",
right: "11%",
textStyle: {
fontSize: 16,
color: "#ffffff",
},
},
grid: {
top: "23%",
left: "1%",
right: "10%",
bottom: "0%",
containLabel: true,
},
calculable: true,
xAxis: [
{
type: "value",
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
data: data.year,
},
{
axisTick: false,
type: "value",
data: data.year,
axisLabel: {
show: false,
},
},
],
yAxis: [
{
type: "category",
splitLine: {
show: true,
lineStyle: {
color: "rgba(226, 226, 226, 0.3)",
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
},
{
type: "category",
min: 0,
max: 100,
splitLine: {
show: false,
lineStyle: {
type: "solid",
color: "rgb(221, 242, 255,0.1)",
},
},
axisLine: {
show: false,
lineStyle: {
type: "dotted",
},
},
axisLabel: {
show: false,
fontSize: 16,
fontFamily: "MicrosoftYaHei",
color: "#ffffff",
lineHeight: 19,
},
},
],
series: [
// {
// z: 1,
// name: "1",
// type: "pictorialBar",
// symbolPosition: "end",
// data: data.zgffrc,
// symbol: "diamond",
// symbolOffset: ["-60%", "-50%"],
// symbolSize: [17, 10],
// itemStyle: {
// borderColor: "#2fffa4",
// color: "rgba(142, 187, 255, 1)",
// },
// },
{
z: 1,
name: "育龄妇女",
type: "bar",
barGap: 0.3 /*多个并排柱子设置柱子之间的间距*/,
data: data.zgffrc,
barWidth: "18%",
label: {
show: true,
color: "#ffffff",
position: "top",
formatter: function (data) {
return data.value + "万";
},
},
// itemStyle: {
// color: 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)",
// },
// ]),
// },
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)" },
],
},
},
},
// {
// z: 2,
// name: "1",
// type: "pictorialBar",
// symbolPosition: "end",
// data: data.cxffrc,
// symbol: "diamond",
// symbolOffset: ["62%", "-50%"],
// symbolSize: [17, 10],
// itemStyle: {
// borderColor: "#32ffee",
// color: "rgba(23, 237, 255, 1)",
// },
// },
{
z: 2,
name: "婴幼儿",
type: "bar",
barGap: 0.3 /*多个并排柱子设置柱子之间的间距*/,
data: data.cxffrc,
barWidth: "18%",
label: {
show: true,
color: "#ffffff",
position: "top",
formatter: function (data) {
return data.value + "万";
},
},
// itemStyle: {
// color: 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)",
// },
// ]),
// },
itemStyle: {
color: {
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)" },
],
},
},
},
// {
// type: "bar",
// xAxisIndex: 1,
// yAxisIndex: 1,
// itemStyle: {
// color: "rgba(221, 242, 255, 0.1)",
// },
// data: data.bg.map(() => 100),
// barWidth: 50,
// },
],
};
};
const setChart = () => {
// Vue3
var myChart = echarts.init(chart.value);
// 使
myChart.setOption(data.option);
};
onBeforeMount(() => {
setTimeout(() => {
data.list = props.list;
data.year = props.year;
data.list.forEach((item) => {
data.zgffrc.push((item.zgffrc / 10000).toFixed(0));
data.cxffrc.push((item.cxffrc / 10000).toFixed(0));
data.bg.push("");
});
// console.log(data.zgffrc,data.cxffrc);
getOption();
setChart();
}, 600);
});
</script>
<style scoped>
</style>

View File

@ -45,11 +45,17 @@
max-height="100vh" max-height="100vh"
style="width: 100%" style="width: 100%"
> >
<el-table-column prop="xh" label="序号" width="50" />
<el-table-column prop="xm" label="姓名" width="60" /> <el-table-column prop="xm" label="姓名" width="60" />
<el-table-column prop="sfzhm" label="身份证号" /> <el-table-column prop="sfzhm" label="身份证" />
<el-table-column prop="sfzhm" label="救助证号" />
<el-table-column prop="sfzhm" label="联系电话" />
<el-table-column prop="sfzhm" label="乡镇(街道)" />
<el-table-column prop="sfzhm" label="村社" />
<el-table-column prop="dz" label="地址" /> <el-table-column prop="dz" label="地址" />
<el-table-column prop="nl" label="年龄" width="60" /> <el-table-column prop="sfzhm" label="救助日期" />
<el-table-column prop="bq" label="人口标签" /> <!-- <el-table-column prop="nl" label="年龄" width="60" /> -->
<!-- <el-table-column prop="bq" label="人口标签" /> -->
</el-table> </el-table>
</div> </div>
</template> </template>
@ -68,7 +74,7 @@ const search = reactive({
}); });
const titleList = reactive([ const titleList = reactive([
{ {
title: "服务项目(未完成)", title: "服务项目(未完成)",
id: 1, id: 1,
}, },
@ -164,7 +170,7 @@ onMounted(() => {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
padding: 20px; padding: 6px;
box-sizing: border-box; box-sizing: border-box;
.tableheader { .tableheader {
box-sizing: border-box; box-sizing: border-box;
@ -172,10 +178,10 @@ onMounted(() => {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding-bottom: 20px; padding-bottom: 20px;
margin-bottom: 20px ; margin-bottom: 20px;
border-bottom: 2px solid #ccc; border-bottom: 2px solid #ccc;
.tableheader_title { .tableheader_title {
font-size: 18px; font-size: 16px;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
position: relative; position: relative;
@ -195,7 +201,7 @@ onMounted(() => {
} }
} }
.select { .select {
margin-bottom: 20px ; margin-bottom: 20px;
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -148,6 +148,7 @@
</div> </div>
</div> </div>
</div> </div>
<infant v-if="gaikuangList.infant"></infant>
<work v-if="gaikuangList.work"></work> <work v-if="gaikuangList.work"></work>
<education v-if="gaikuangList.education"></education> <education v-if="gaikuangList.education"></education>
<yl v-if="gaikuangList.yl"></yl> <yl v-if="gaikuangList.yl"></yl>
@ -173,6 +174,7 @@ import Bj1 from "@/assets/sy-table/sy-table7.png";
import Bj2 from "@/assets/sy-table/sy-table4.png"; import Bj2 from "@/assets/sy-table/sy-table4.png";
import Bj3 from "@/assets/sy-table/sy-table5.png"; import Bj3 from "@/assets/sy-table/sy-table5.png";
import Bj4 from "@/assets/sy-table/sy-table6.png"; import Bj4 from "@/assets/sy-table/sy-table6.png";
import infant from "./table_gk/gk_infant.vue";
import work from "./table_gk/gk_work.vue"; import work from "./table_gk/gk_work.vue";
import education from "./table_gk/gk_education.vue"; import education from "./table_gk/gk_education.vue";
import yl from "./table_gk/gk_yl.vue"; import yl from "./table_gk/gk_yl.vue";
@ -227,14 +229,18 @@ const data = reactive({
son: [ son: [
{ {
id: "0", id: "0",
name: "优孕优生服务", name: "概况",
}, },
{ {
id: "1", id: "1",
name: "儿童健康服务", name: "优孕优生服务",
}, },
{ {
id: "2", id: "2",
name: "儿童健康服务",
},
{
id: "3",
name: "儿童关爱服务", name: "儿童关爱服务",
}, },
], ],
@ -510,6 +516,7 @@ const data = reactive({
Bj: [Bj, Bj1, Bj2, Bj3, Bj4], Bj: [Bj, Bj1, Bj2, Bj3, Bj4],
}); });
const gaikuangList = reactive({ const gaikuangList = reactive({
infant: false,
work: false, work: false,
education: false, education: false,
yl: false, yl: false,
@ -519,6 +526,7 @@ const gaikuangList = reactive({
const show_7yx = ref(true); const show_7yx = ref(true);
const gk = computed(() => { const gk = computed(() => {
if ( if (
gaikuangList.infant ||
gaikuangList.work || gaikuangList.work ||
gaikuangList.hygiene || gaikuangList.hygiene ||
gaikuangList.education || gaikuangList.education ||
@ -538,7 +546,8 @@ const tapshow = (parentId, childId) => {
localStorage.setItem("taps1", JSON.stringify(parentId)); localStorage.setItem("taps1", JSON.stringify(parentId));
if ( if (
childId == 0 && childId == 0 &&
(parentId.name == "弱有所扶" || (parentId.name == "幼有所育" ||
parentId.name == "弱有所扶" ||
parentId.name == "学有所教" || parentId.name == "学有所教" ||
parentId.name == "老有所养" || parentId.name == "老有所养" ||
parentId.name == "病有所医") parentId.name == "病有所医")
@ -594,7 +603,9 @@ const gaikuang = (name) => {
for (let name in gaikuangList) { for (let name in gaikuangList) {
gaikuangList[name] = false; gaikuangList[name] = false;
} }
if (name == "弱有所扶") { if (name == "幼有所育") {
gaikuangList.infant = true;
} else if (name == "弱有所扶") {
gaikuangList.work = true; gaikuangList.work = true;
} else if (name == "学有所教") { } else if (name == "学有所教") {
gaikuangList.education = true; gaikuangList.education = true;

File diff suppressed because it is too large Load Diff