Merge branch 'main' of git.zdool.com:xs/ggfwjsc

This commit is contained in:
姚宇浩 2024-05-27 15:56:54 +08:00
commit f4f02dfc85
3 changed files with 662 additions and 547 deletions

View File

@ -3,19 +3,57 @@
</template> </template>
<script setup> <script setup>
import { onMounted, reactive, ref } from "vue"; import {
onBeforeMount,
onMounted,
ref,
reactive,
defineProps,
nextTick,
} from "vue";
// echarts // echarts
import * as echarts from "echarts"; import * as echarts from "echarts";
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
// list2: {
// type: Array,
// default: () => {
// return [];
// },
// },
year: {
type: Array,
default: () => {
return [];
},
},
});
const chart = ref(); // DOM const chart = ref(); // DOM
const data = [120, 200, 50, 80, 70]; const data = reactive({
const lineData = [1500, 2300, 204, 2018, 1305]; list: [],
const max = data list1: [],
.concat(lineData) list2: [],
.reduce((pre, cur) => (pre > cur ? pre : cur), 0); // year: [],
option: {},
// max: null,
});
const option = { // const data1 = [120, 200, 50, 80, 70];
// const lineData = [1500, 2300, 204, 2018, 1305];
// const max = data1
// .concat(lineData)
// .reduce((pre, cur) => (pre > cur ? pre : cur), 0); //
const getOption = () => {
data.option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}", formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
@ -51,12 +89,13 @@ const option = {
axisTick: { axisTick: {
show: false, // show: false, //
}, },
data: ["2019", "2020", "2021", "2022", "2023"], // data: ["2019", "2020", "2021", "2022", "2023"],
data: data.list.year,
}, },
{ {
type: "category", type: "category",
show: false, show: false,
data: ["2019", "2020", "2021", "2022", "2023"], data: data.list.year,
}, },
], ],
yAxis: [ yAxis: [
@ -64,7 +103,7 @@ const option = {
type: "value", type: "value",
scale: true, scale: true,
name: "救助人数", name: "救助人数",
min: 0,
splitLine: { splitLine: {
//线 //线
show: false, show: false,
@ -153,18 +192,18 @@ const option = {
{ {
yAxisIndex: 1, yAxisIndex: 1,
name: "救助金额", name: "救助金额",
data: lineData, data: data.list2,
type: "line", //线 type: "line", //线
stack: "Total", stack: "Total",
symbol: "emptyCircle", symbol: "emptyCircle",
symbolSize: 10, symbolSize: 10,
label:{ label: {
show:true, show: true,
position:'top', position: "top",
color:'#ffffff', color: "#ffffff",
formatter:function(data){ formatter: function (data) {
return data.value return data.value;
} },
}, },
itemStyle: { itemStyle: {
borderColor: "#00FCFF", borderColor: "#00FCFF",
@ -175,16 +214,16 @@ const option = {
{ {
yAxisIndex: 0, yAxisIndex: 0,
name: "救助人数", name: "救助人数",
data: data, data: data.list1,
barWidth: 20, barWidth: 20,
type: "bar", type: "bar",
label:{ label: {
show:true, show: true,
position:'insideTop', // position: "insideTop",
color:'#ffffff', color: "#ffffff",
formatter:function(data){ formatter: function (data) {
return data.value return data.value;
} },
}, },
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@ -227,27 +266,34 @@ const option = {
itemStyle: { itemStyle: {
color: "rgba(221, 242, 255, 0.1)", color: "rgba(221, 242, 255, 0.1)",
}, },
data: ["2019", "2020", "2021", "2022", "2023"].map(() => 100), data: data.list.year.map(() => 100),
barWidth: 50, barWidth: 50,
}, },
], ],
};
};
const setChart = () => {
var myChart = echarts.init(chart.value);
myChart.setOption(data.option);
};
const setChart1 = () => {
data.list.data.forEach((item) => {
data.list1.push(item.jzrs); //
data.list2.push(item.jzje); //
});
}; };
// 使 // 使
onMounted(() => { onBeforeMount(() => {
// domecharts setTimeout(() => {
// var myChart = echarts.init(document.getElementById('main')); data.list = props.list;
// Vue3 setChart1();
var myChart = echarts.init(chart.value); // console.log(data.list, data.list1, data.list2, "");
getOption();
// init(); // vue3.2this setChart();
// 使 }, 600);
myChart.setOption(option);
// :
// window.addEventListener("resize", () => {
// myChart.resize();
// });
}); });
</script> </script>

View File

@ -1,46 +1,59 @@
<template> <template>
<div ref="chart" style="width: 100%; height: 340px"></div> <div ref="chart" style="width: 100%; height: 330px"></div>
</template> </template>
<script setup> <script setup>
import { onMounted, reactive, ref } from "vue"; import {
onBeforeMount,
onMounted,
ref,
reactive,
defineProps,
nextTick,
} from "vue";
// echarts // echarts
import * as echarts from "echarts"; import * as echarts from "echarts";
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
// list2: {
// type: Array,
// default: () => {
// return [];
// },
// },
year: {
type: Array,
default: () => {
return [];
},
},
});
const chart = ref(); // DOM const chart = ref(); // DOM
const data = [1200, 2000, 500, 800, 700]; const data = reactive({
const lineData = [150, 230, 24, 218, 135]; list: [],
const max = data list1: [],
.concat(lineData) list2: [],
.reduce((pre, cur) => (pre > cur ? pre : cur), 0); // year: [],
const maxRs = data.reduce((pre, cur) => (pre > cur ? pre : cur), 0); option: {},
const maxJe = lineData.reduce((pre, cur) => (pre > cur ? pre : cur), 0); // max: null,
// });
const color = [
{ // const data1 = [120, 200, 50, 80, 70];
type: "linear", // const lineData = [1500, 2300, 204, 2018, 1305];
x: 0, // const max = data1
x2: 0, // .concat(lineData)
y: 0, // .reduce((pre, cur) => (pre > cur ? pre : cur), 0); //
y2: 1,
colorStops: [ const getOption = () => {
{ data.option = {
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 = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}", formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
@ -59,10 +72,9 @@ const option = {
bottom: "0%", bottom: "0%",
containLabel: true, containLabel: true,
color: "#ffffff", color: "#ffffff",
fontSize: 14,
}, },
calculable: true, calculable: true,
color,
xAxis: [ xAxis: [
{ {
type: "category", type: "category",
@ -77,12 +89,13 @@ const option = {
axisTick: { axisTick: {
show: false, // show: false, //
}, },
data: ["2019", "2020", "2021", "2022", "2023"], // data: ["2019", "2020", "2021", "2022", "2023"],
data: data.list.year,
}, },
{ {
type: "category", type: "category",
show: false, show: false,
data: ["2019", "2020", "2021", "2022", "2023"], data: data.list.year,
}, },
], ],
yAxis: [ yAxis: [
@ -90,7 +103,7 @@ const option = {
type: "value", type: "value",
scale: true, scale: true,
name: "救助人数", name: "救助人数",
min: 0,
splitLine: { splitLine: {
//线 //线
show: false, show: false,
@ -103,8 +116,8 @@ const option = {
axisLabel: { axisLabel: {
//y //y
textStyle: { textStyle: {
color: "#ffffff",
fontSize: 14, fontSize: 14,
color: "#ffffff",
}, },
}, },
axisLine: { axisLine: {
@ -169,9 +182,9 @@ const option = {
axisLabel: { axisLabel: {
show: false, show: false,
fontSize: 14, fontSize: 14,
color: "#DEF1FF",
lineHeight: 19,
fontFamily: "MicrosoftYaHei", fontFamily: "MicrosoftYaHei",
color: "#ffffff",
lineHeight: 19,
}, },
}, },
], ],
@ -179,18 +192,18 @@ const option = {
{ {
yAxisIndex: 1, yAxisIndex: 1,
name: "救助金额", name: "救助金额",
data: lineData, data: data.list2,
type: "line", //线 type: "line", //线
stack: "Total", stack: "Total",
symbol: "emptyCircle", symbol: "emptyCircle",
symbolSize: 10, symbolSize: 10,
label:{ label: {
show:true, show: true,
position:'top', position: "top",
color:'#ffffff', color: "#ffffff",
formatter:function(data){ formatter: function (data) {
return data.value return data.value;
} },
}, },
itemStyle: { itemStyle: {
borderColor: "#00FCFF", borderColor: "#00FCFF",
@ -201,16 +214,16 @@ const option = {
{ {
yAxisIndex: 0, yAxisIndex: 0,
name: "救助人数", name: "救助人数",
data: data, data: data.list1,
barWidth: 20, barWidth: 20,
type: "bar", type: "bar",
label:{ label: {
show:true, show: true,
position:'insideTop', // position: "insideTop",
color:'#ffffff', color: "#ffffff",
formatter:function(data){ formatter: function (data) {
return data.value return data.value;
} },
}, },
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@ -253,16 +266,34 @@ const option = {
itemStyle: { itemStyle: {
color: "rgba(221, 242, 255, 0.1)", color: "rgba(221, 242, 255, 0.1)",
}, },
data: ["2019", "2020", "2021", "2022", "2023"].map(() => 100), data: data.list.year.map(() => 100),
barWidth: 50, barWidth: 50,
}, },
], ],
};
};
const setChart = () => {
var myChart = echarts.init(chart.value);
myChart.setOption(data.option);
};
const setChart1 = () => {
data.list.data.forEach((item) => {
data.list1.push(item.jzrs); //
data.list2.push(item.jzje); //
});
}; };
// 使 // 使
onMounted(() => { onBeforeMount(() => {
var myChart = echarts.init(chart.value); setTimeout(() => {
myChart.setOption(option); data.list = props.list;
setChart1();
// console.log(data.list, data.list1, data.list2, "");
getOption();
setChart();
}, 600);
}); });
</script> </script>

View File

@ -21,14 +21,14 @@
> >
医疗 医疗
</div> </div>
<div <!-- <div
:class="jz[0].choose == '3' ? 'choose_1' : 'choose_2'" :class="jz[0].choose == '3' ? 'choose_1' : 'choose_2'"
@click="jzChange(0, '3')" @click="jzChange(0, '3')"
> >
就业 就业
</div> -->
</div> </div>
</div> <eP1 :list="data.education"></eP1>
<eP1></eP1>
<div class="choose"> <div class="choose">
<div <div
:class="jz[1].choose == '1' ? 'choose_1' : 'choose_2'" :class="jz[1].choose == '1' ? 'choose_1' : 'choose_2'"
@ -36,12 +36,12 @@
> >
住房 住房
</div> </div>
<div <!-- <div
:class="jz[1].choose == '2' ? 'choose_1' : 'choose_2'" :class="jz[1].choose == '2' ? 'choose_1' : 'choose_2'"
@click="jzChange(1, '2')" @click="jzChange(1, '2')"
> >
自然灾害 自然灾害
</div> </div> -->
<div <div
:class="jz[1].choose == '3' ? 'choose_1' : 'choose_2'" :class="jz[1].choose == '3' ? 'choose_1' : 'choose_2'"
@click="jzChange(1, '3')" @click="jzChange(1, '3')"
@ -49,7 +49,7 @@
临时救助 临时救助
</div> </div>
</div> </div>
<eP2></eP2> <eP2 :list="data.housing"></eP2>
</div> </div>
</div> </div>
<div class="displayFlex center_bg"> <div class="displayFlex center_bg">
@ -70,7 +70,12 @@
<span>金额()</span> <span>金额()</span>
<!-- <span>数据对比</span> --> <!-- <span>数据对比</span> -->
</div> </div>
<div class="rolling"> <div
class="rolling"
ref="mainRef"
@mouseenter="stopAutoScroll"
@mouseleave="startAutoScroll"
>
<div <div
v-for="(item, index) in data.lifeAssistance.subsidyInformation" v-for="(item, index) in data.lifeAssistance.subsidyInformation"
:key="index" :key="index"
@ -111,42 +116,31 @@
</div> </div>
<div class="flex1"> <div class="flex1">
<div class="yd_title right_2"></div> <div class="yd_title right_2"></div>
<div style="margin-top: 20px"> <div class="dyh">
<div class="czr-bj"> <div
class="czr-bj"
v-for="(item, index) in data.diversification.hszhxms"
:key="index"
>
<div class="czrBox"> <div class="czrBox">
<div class="situation situation1"></div> <div>发起单位:</div>
<div class="column"> <div>{{ item.fqdw }}</div>
<!-- <div v-for="item in data.diversification.hszhxms">
发起单位: {{ item.fqdw }}
<br>
项目名称: {{item.xmmc}}
<br>
公众筹款金额(): {{ item.gzzcje }}
<br>
捐赠支出金额: {{ item.jzzcje }}
<br>
捐赠人次: {{ item.jzrc }}
</div> -->
</div>
</div> </div>
<div class="czrBox"> <div class="czrBox">
<div class="situation situation2"></div> <div>项目名称:</div>
<div class="column"> <div>{{ item.xmmc }}</div>
<div v-for="item in data.diversification.hszhxms">
发起单位: {{ item.fqdw }}
<br />
项目名称: {{ item.xmmc }}
<br />
公众筹款金额(): {{ item.gzzcje }}
<br />
捐赠支出金额: {{ item.jzzcje }}
<br />
捐赠人次: {{ item.jzrc }}
</div>
</div>
</div> </div>
<div class="czrBox"> <div class="czrBox">
<div class="situation situation3"></div> <div>公众筹款金额():</div>
<div>{{ item.gzzcje }}</div>
</div>
<div class="czrBox">
<div>捐赠支出金额:</div>
<div>{{ item.jzzcje }}</div>
</div>
<div class="czrBox">
<div>捐赠人次:</div>
<div>{{ item.jzrc }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -235,11 +229,12 @@ const getData = async () => {
await http.get("/api/ggfwyth/succour").then((res) => { await http.get("/api/ggfwyth/succour").then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.data); console.log(res.data);
data.diversification.hszhxms = res.data.diversification.hszhxms;
// //
// && // &
data.education.data = res.data.specialAssistance.education.data; data.education.data = res.data.specialAssistance.education.data;
data.education.year = res.data.specialAssistance.education.year; data.education.year = res.data.specialAssistance.education.year;
// && // &
data.housing.data = res.data.specialAssistance.housing.data; data.housing.data = res.data.specialAssistance.housing.data;
data.housing.year = res.data.specialAssistance.housing.year; data.housing.year = res.data.specialAssistance.housing.year;
// //
@ -258,9 +253,42 @@ const getData = async () => {
} }
}); });
}; };
//
const mainRef = ref(null);
let isAutoScrolling = true;
const stopAutoScroll = () => {
isAutoScrolling = false;
};
const startAutoScroll = () => {
isAutoScrolling = true;
autoScroll();
};
const autoScroll = () => {
if (!isAutoScrolling) return;
const mainEl = mainRef.value;
mainEl.scrollTop += 1; //
if (mainEl.scrollTop + 1 >= mainEl.scrollHeight - mainEl.clientHeight) {
setTimeout(() => {
mainEl.scrollTo({ top: 0, behavior: "smooth" });
setTimeout(autoScroll, 2000); // 2
}, 1000); // 1
} else {
requestAnimationFrame(autoScroll);
}
};
onBeforeMount(() => { onBeforeMount(() => {
getData(); getData();
}); });
onMounted(() => {
startAutoScroll();
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -322,6 +350,7 @@ onBeforeMount(() => {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.left_1_1 { .left_1_1 {
background-image: url(@/assets/images/work/new_qtjz.png); background-image: url(@/assets/images/work/new_qtjz.png);
background-repeat: no-repeat; background-repeat: no-repeat;
@ -351,6 +380,7 @@ onBeforeMount(() => {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.right_2 { .right_2 {
background-image: url(@/assets/images/work/new_dyh.png); background-image: url(@/assets/images/work/new_dyh.png);
background-repeat: no-repeat; background-repeat: no-repeat;
@ -597,11 +627,13 @@ onBeforeMount(() => {
top: 3px; top: 3px;
} }
} }
.choose { .choose {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-top: 47px; margin-top: 47px;
margin-bottom: 20px; margin-bottom: 20px;
.choose_1 { .choose_1 {
cursor: pointer; cursor: pointer;
width: 124px; width: 124px;
@ -618,6 +650,7 @@ onBeforeMount(() => {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.choose_2 { .choose_2 {
cursor: pointer; cursor: pointer;
width: 124px; width: 124px;
@ -645,6 +678,7 @@ onBeforeMount(() => {
.flex11 { .flex11 {
padding: 12px 0; padding: 12px 0;
} }
.czr-sl { .czr-sl {
display: flex; display: flex;
@ -780,57 +814,49 @@ onBeforeMount(() => {
} }
} }
.czr-bj { .dyh {
width: 529px; margin-top: 10px;
// height: 350px; overflow: hidden;
height: 380px;
overflow-y: auto;
width: 100%;
.czr-bj {
width: 480px;
// height: calc(100% - 26px); // height: calc(100% - 26px);
background: rgba(0, 103, 165, 0.18); background: rgba(0, 103, 165, 0.18);
box-shadow: inset 0px 0px 58px 0px rgba(37, 175, 252, 0.47); box-shadow: inset 0px 0px 58px 0px rgba(37, 175, 252, 0.47);
border-radius: 2px; border-radius: 2px;
padding: 20px 0 0 14px; padding: 20px 26px 1px 32px;
margin: 0 auto 12px;
// box-sizing: border-box; // box-sizing: border-box;
.czrBox { .czrBox {
height: 118px; height: 22px;
.column { font-weight: 500;
height: calc(100% - 26px); font-size: 16px;
overflow-y: auto;
font-size: 14px;
color: #ffffff; color: #ffffff;
padding-left: 18px; line-height: 22px;
padding-right: 18px; letter-spacing: 3px;
text-shadow: 0px 0px 17px rgba(0, 255, 254, 0.5);
display: flex;
justify-content: space-between;
margin-bottom: 20px;
} }
} }
.situation {
width: 495px;
height: 26px;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.situation1 {
background-image: url(@/assets/images/work/dyh.png);
}
.situation2 {
background-image: url(@/assets/images/work/dyh2.png);
}
.situation3 {
background-image: url(@/assets/images/work/dyh1.png);
}
} }
.school { .school {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
} }
.fundingBox { .fundingBox {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.funding { .funding {
width: 520px; width: 520px;
height: 34px; height: 34px;
@ -843,6 +869,7 @@ onBeforeMount(() => {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
// align-items: center; // align-items: center;
// justify-content: center; // justify-content: center;
// flex-direction: column; // flex-direction: column;
@ -856,6 +883,7 @@ onBeforeMount(() => {
letter-spacing: 3px; letter-spacing: 3px;
} }
} }
.rolling { .rolling {
width: 100%; width: 100%;
height: 200px; height: 200px;
@ -864,7 +892,7 @@ onBeforeMount(() => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
// padding-left: 6px; padding-left: 6px;
.fundingContent { .fundingContent {
display: flex; display: flex;
@ -888,6 +916,7 @@ onBeforeMount(() => {
width: 70%; width: 70%;
padding-left: 38px; padding-left: 38px;
} }
span:nth-child(2) { span:nth-child(2) {
width: 30%; width: 30%;
// padding-left: 50px; // padding-left: 50px;
@ -895,11 +924,13 @@ onBeforeMount(() => {
} }
} }
} }
.rating { .rating {
width: 50%; width: 50%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.ratingBtn { .ratingBtn {
display: flex; display: flex;
// align-items: center; // align-items: center;
@ -910,7 +941,8 @@ onBeforeMount(() => {
background-image: url(@/assets/eduImg/jyImg19.png); background-image: url(@/assets/eduImg/jyImg19.png);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
cursor: pointer; /* 添加指针样式以指示可点击 */ cursor: pointer;
/* 添加指针样式以指示可点击 */
} }
.ratingImg { .ratingImg {
@ -920,6 +952,7 @@ onBeforeMount(() => {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.onImg.active { .onImg.active {
width: 62px; width: 62px;
height: 29px; height: 29px;
@ -927,6 +960,7 @@ onBeforeMount(() => {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
span { span {
height: 100%; height: 100%;
display: flex; display: flex;
@ -955,20 +989,24 @@ onBeforeMount(() => {
} }
} }
.column::-webkit-scrollbar { .dyh::-webkit-scrollbar {
display: none; /* Chrome Safari */ display: none;
/* Chrome Safari */
} }
/* 滚动条整体部分 */ /* 滚动条整体部分 */
.rolling::-webkit-scrollbar { .rolling::-webkit-scrollbar {
width: 5px; width: 5px;
// height: 10px; // height: 10px;
} }
/* 滚动槽 */ /* 滚动槽 */
.rolling::-webkit-scrollbar-track { .rolling::-webkit-scrollbar-track {
border-radius: 1px; border-radius: 1px;
background: rgba(0, 128, 231, 0.56); background: rgba(0, 128, 231, 0.56);
-webkit-box-shadow: inset 0 0 6px rgba(139, 139, 139, 0.3); -webkit-box-shadow: inset 0 0 6px rgba(139, 139, 139, 0.3);
} }
/* 滚动条滑块样式 */ /* 滚动条滑块样式 */
.rolling::-webkit-scrollbar-thumb { .rolling::-webkit-scrollbar-thumb {
background-clip: content-box; background-clip: content-box;