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

This commit is contained in:
duanxiaohai 2024-06-20 09:55:31 +08:00
commit 7d165b139e
2 changed files with 225 additions and 100 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%; height: 260px"></div> <div ref="chart" style="width: 50%; height: 260px"></div>
</template> </template>
<script setup> <script setup>
@ -172,51 +172,51 @@ const getOption1 = () => {
const getOption = () => { const getOption = () => {
data.option = { data.option = {
// //
legend: [ // legend: [
{ // {
orient: "vertical", // orient: "vertical",
right: "5%", // right: "10%",
top: "center", // top: "15%",
type: "scroll", // type: "scroll",
height: "80%", // height: "80%",
itemWidth: 20, // // itemWidth: 20, //
itemHeight: 10, // // itemHeight: 10, //
itemGap: 20, // itemGap: 20,
// itemStyle: { // // itemStyle: {
// borderColor: "rgba(255,255,255,0.2)", // // // borderColor: "rgba(255,255,255,0.2)", //
// borderWidth: 10, // // // borderWidth: 10, //
// borderRadius: 20, // // borderRadius: 20,
// }, // // },
pageTextStyle: { // pageTextStyle: {
color: "#ffffff", // color: "#ffffff",
fontSize: 14, // fontSize: 14,
padding: 10, // padding: 10,
}, // },
textStyle: { // textStyle: {
color: "#ffffff", // color: "#ffffff",
fontSize: 14, // fontSize: 14,
padding: 10, // padding: 10,
rich: { // rich: {
name: { // name: {
width: 80, // width: 80,
fontSize: 16, // fontSize: 16,
}, // },
}, // },
}, // },
data: data.list, // data: data.list,
// // //
formatter: function (name) { // formatter: function (name) {
var target; // var target;
for (var i = 0, l = data.list.length; i < l; i++) { // for (var i = 0, l = data.list.length; i < l; i++) {
if (data.list[i].name == name) { // if (data.list[i].name == name) {
target = data.list[i].value; // target = data.list[i].value;
} // }
} // }
return `${name}${target}`; // return `${name}${target} `;
}, // },
}, // },
], // ],
tooltip: { tooltip: {
trigger: "item", trigger: "item",
@ -234,7 +234,7 @@ const getOption = () => {
type: "pie", type: "pie",
roseType: "radius", roseType: "radius",
radius: ["15%", "90%"], radius: ["15%", "90%"],
center: ["35%", "50%"], center: ["45%", "40%"],
label: { label: {
position: "inside", position: "inside",
formatter(item) { formatter(item) {
@ -276,7 +276,7 @@ const getOption = () => {
type: "pie", type: "pie",
roseType: "radius", roseType: "radius",
radius: ["15%", "92%"], radius: ["15%", "92%"],
center: ["35%", "50%"], center: ["45%", "40%"],
label: { label: {
show: false, show: false,
}, },

View File

@ -230,7 +230,22 @@
</div> </div>
</div> </div>
<ePie2 style="margin-top: 20px" :list="data.ageRatio"></ePie2> <ePie2 style="margin-top: 20px" :list="data.ageRatio"></ePie2>
<ePie style="margin-bottom: 20px" :list="data.ageGroup"></ePie> <div class="bt">
<ePie style="margin-bottom: 20px" :list="data.ageGroup"></ePie>
<div
class="btList"
ref="mainRef"
@mouseenter="stopAutoScroll"
@mouseleave="startAutoScroll"
>
<div class="btList_item" v-for="(item, index) in btList">
<div class="btList_item_color" :style="bt(index)"></div>
<div class="btList_item_value">
{{ item.name }}{{ item.value }}
</div>
</div>
</div>
</div>
<div class="table"> <div class="table">
<div class="table_choose"> <div class="table_choose">
<div <div
@ -436,6 +451,7 @@
</div> </div>
<div class="flex1" style="margin-top: 10px"> <div class="flex1" style="margin-top: 10px">
<div class="yd_title last_1"> <div class="yd_title last_1">
<div class="gTitle"> 近30天 </div>
<div class="animate-border"> <div class="animate-border">
<i></i> <i></i>
<i></i> <i></i>
@ -571,7 +587,7 @@
> >
<template #dd="{ currentCol, currentData }"> <template #dd="{ currentCol, currentData }">
<div> <div>
{{currentData.dd.substring(0,currentData.dd.indexOf("."))}} {{ currentData.dd.substring(0, currentData.dd.indexOf(".")) }}
</div> </div>
</template> </template>
</DialogTab> </DialogTab>
@ -1053,48 +1069,6 @@ const data = reactive({
], ],
}); });
// const tableData = ref([
// {
// company: "",
// address: "",
// finish: true,
// },
// {
// company: "",
// address: "",
// finish: true,
// },
// {
// company: "",
// address: "",
// finish: true,
// },
// {
// company: "",
// address: "",
// finish: false,
// },
// {
// company: "",
// address: "",
// finish: false,
// },
// {
// company: "",
// address: "",
// finish: false,
// },
// {
// company: "",
// address: "",
// finish: false,
// },
// {
// company: "",
// address: "",
// finish: false,
// },
// ]);
const jysyList = ref([ const jysyList = ref([
{ {
title: "县镇", title: "县镇",
@ -1232,9 +1206,25 @@ const getData = async () => {
"nl91100", "nl91100",
"nl100", "nl100",
]; ];
const ageBt = [
"nl110",
"nl1120",
"nl2130",
"nl3140",
"nl4150",
"nl5160",
"nl6170",
"nl7180",
"nl8190",
"nl91100",
"nl100",
];
ageGroupKeys.forEach((key) => { ageGroupKeys.forEach((key) => {
data.ageGroup[key] = res.data.rksj[key]; data.ageGroup[key] = res.data.rksj[key];
}); });
ageBt.forEach((key, index) => {
btList.value[index].value = res.data.rksj[key];
});
} }
// //
const ageRatioKeys = [ const ageRatioKeys = [
@ -1334,9 +1324,6 @@ const qyfyList = reactive([
img: qyfw4, img: qyfw4,
}, },
]); ]);
onBeforeMount(async () => {
getData();
});
// //
const showEc = (val) => { const showEc = (val) => {
@ -1352,10 +1339,10 @@ const showEc = (val) => {
break; break;
case "电动单车": case "电动单车":
http.get("/api/ggfwyth/ddcList").then((res) => { http.get("/api/ggfwyth/ddcList").then((res) => {
if(res.code == 200){ if (res.code == 200) {
dataEc.list1=res.data.qxcs; dataEc.list1 = res.data.qxcs;
dataEc.list2=res.data.qxsc; dataEc.list2 = res.data.qxsc;
dataEc.times=res.data.times; dataEc.times = res.data.times;
dialogShowEc.value = true; dialogShowEc.value = true;
} }
}); });
@ -1418,8 +1405,8 @@ const showTab = (val) => {
getTableTab("/api/ggfwyth/lyzlcskList", pagination.currentPage); getTableTab("/api/ggfwyth/lyzlcskList", pagination.currentPage);
http.get(`/api/ggfwyth/lckll`).then((res) => { http.get(`/api/ggfwyth/lckll`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
dataTab.list1=res.data.data; dataTab.list1 = res.data.data;
dataTab.times=res.data.times; dataTab.times = res.data.times;
} }
}); });
break; break;
@ -1427,6 +1414,107 @@ const showTab = (val) => {
break; break;
} }
}; };
//()
//
const colorList = [
{ color2: "rgba(90,255,223,1)" },
{ color2: "rgba(115,255,145,1)" },
{ color2: "rgba(153,255,179,1)" },
{ color2: "rgba(193,255,138,1)" },
{ color2: "rgba(255,207,74,1)" },
{ color2: "rgba(254,178,128,1)" },
{ color2: "rgba(151,176,255,1)" },
{ color2: "rgba(164,151,255,1)" },
{ color2: "rgba(159,110,254,1)" },
{ color2: "rgba(180,143,241,1)" },
{ color2: "rgba(76,174,254,1)" },
];
const bt = computed(() => {
return function (index) {
let str = `--i:${colorList[index].color2}`;
return str;
};
});
const btList = ref([
{
name: "1-10岁人口总数",
value: "",
},
{
name: "11-20岁人口总数",
value: "",
},
{
name: "21-30岁人口总数",
value: "",
},
{
name: "31-40岁人口总数",
value: "",
},
{
name: "41-50岁人口总数",
value: "",
},
{
name: "51-60岁人口总数",
value: "",
},
{
name: "61-70岁人口总数",
value: "",
},
{
name: "71-80岁人口总数",
value: "",
},
{
name: "81-90岁人口总数",
value: "",
},
{
name: "91-100岁人口总数",
value: "",
},
{
name: "100岁以上人口总数",
value: "",
},
]);
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(async () => {
getData();
setTimeout(()=>{
startAutoScroll();
},1000)
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -1607,6 +1695,14 @@ const showTab = (val) => {
right: 5px; right: 5px;
top: 1px; top: 1px;
} }
.gTitle{
position: absolute;
color: #ACD1F1;
height: 100%;
display: flex;
align-items: center;
left: 156px;
}
.c { .c {
width: 130px; width: 130px;
@ -2356,7 +2452,36 @@ const showTab = (val) => {
} }
} }
} }
//list
.bt {
display: flex;
align-items: center;
}
.btList {
width: 45%;
height: 200px;
overflow-y: auto;
.btList_item {
box-sizing: border-box;
width: 100%;
padding: 5px;
.btList_item_color {
width: 30px;
height: 10px;
background-color: var(--i);
border-radius: 3px;
}
.btList_item_value {
font-size: 18px;
margin-top: 5px;
color: #ffffff;
}
}
}
.btList::-webkit-scrollbar {
display: none;
}
.table { .table {
width: 94%; width: 94%;
margin-left: 5px; margin-left: 5px;