Browse Source

维权抚慰 数字滚动

main
parent
commit
0b91dfffa7
  1. 305
      src/views/datav/RightsComfort.vue

305
src/views/datav/RightsComfort.vue

@ -41,27 +41,27 @@
<datav-date-picker v-model="time"/> <datav-date-picker v-model="time"/>
<div class="flex gap-42"> <div class="flex gap-42">
<datav-statistic <datav-statistic
:value="171" :value="temp.tempTotalCase"
title="维权案件总数" title="维权案件总数"
style="width: 20%" style="width: 20%"
/> />
<datav-statistic <datav-statistic
:value="121" :value="temp.tempVictimPer"
title="受侵害人数" title="受侵害人数"
style="width: 20%" style="width: 20%"
/> />
<datav-statistic <datav-statistic
:value="114" :value="temp.tempComfortPer"
title="抚慰人数" title="抚慰人数"
style="width: 20%" style="width: 20%"
/> />
<datav-statistic <datav-statistic
:value="205" :value="temp.tempHitPro"
title="打击处理人数" title="打击处理人数"
style="width: 20%" style="width: 20%"
/> />
<datav-statistic <datav-statistic
:value="28.1" :value="temp.tempComfortMon"
:title="`抚慰金额\n(万元)`" :title="`抚慰金额\n(万元)`"
:isDecimal="true" :isDecimal="true"
style="width: 20%" style="width: 20%"
@ -139,6 +139,26 @@ import * as echarts from "echarts/core";
import {getRightsComfortData} from "@/api/datav"; import {getRightsComfortData} from "@/api/datav";
import moment from "moment"; import moment from "moment";
const temp = ref({
tempTotalCase: 0,
tempVictimPer: 0,
tempComfortPer: 0,
tempHitPro: 0,
tempComfortMon: 0,
})
setTimeout(() => {
temp.value={
tempTotalCase: 171,
tempVictimPer: 121,
tempComfortPer: 114,
tempHitPro: 205,
tempComfortMon: 28.1,
}
}, 1000);
echarts.registerMap("changsha", changshaMap); echarts.registerMap("changsha", changshaMap);
const time = ref([ const time = ref([
moment().startOf("year").format("YYYY-MM-DD"), moment().startOf("year").format("YYYY-MM-DD"),
@ -149,16 +169,98 @@ const hitPersonNumber = ref(28.1);
const comfortMoney = ref(0.0); const comfortMoney = ref(0.0);
const punishmentSituationList = ref([]); const punishmentSituationList = ref([]);
const comfortSituationList = ref([]); const comfortSituationList = ref([]);
let gobalTempMapVoList = [
{
"name": "岳麓分局",
"totalCase": 23,
"victimPer": "暂无",
"comfortPer": "19",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "芙蓉分局",
"totalCase": 20,
"victimPer": "暂无",
"comfortPer": "12",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "天心分局",
"totalCase": 20,
"victimPer": "暂无",
"comfortPer": "23",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "雨花分局",
"totalCase": 19,
"victimPer": "暂无",
"comfortPer": "16",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "浏阳市局",
"totalCase": 17,
"victimPer": "暂无",
"comfortPer": "30",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "宁乡市局",
"totalCase": 11,
"victimPer": "暂无",
"comfortPer": "0",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "开福分局",
"totalCase": 11,
"victimPer": "暂无",
"comfortPer": "4",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "望城分局",
"totalCase": 9,
"victimPer": "暂无",
"comfortPer": "0",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "长沙县局",
"totalCase": 9,
"victimPer": "暂无",
"comfortPer": "0",
"hitPro": "暂无",
"comfortMon": "暂无",
},
{
"name": "高新分局",
"totalCase": 4,
"victimPer": "暂无",
"comfortPer": "7",
"hitPro": "暂无",
"comfortMon": "暂无",
},
];
function getData() { function getData() {
// getRightsComfortData(time.value).then((data) => { getRightsComfortData(time.value).then((data) => {
// console.log('Received data:', data); // console.log('Received data:', data); //
// comfortPersonNumber.value = data.comfortPersonNumber; comfortPersonNumber.value = data.comfortPersonNumber;
// hitPersonNumber.value = data.hitPersonNumber; hitPersonNumber.value = data.hitPersonNumber;
// comfortMoney.value = data.comfortMoney; comfortMoney.value = data.comfortMoney;
// punishmentSituationList.value = data.punishmentSituation; punishmentSituationList.value = data.punishmentSituation;
// comfortSituationList.value = data.comfortSituation; comfortSituationList.value = data.comfortSituation;
// }); });
} }
watch(time, () => { watch(time, () => {
@ -167,29 +269,65 @@ watch(time, () => {
onMounted(() => { onMounted(() => {
getData(); getData();
}); });
const option = { const option = ref({
geo: { geo: {
// registerMap''
map: "changsha", map: "changsha",
},
},
tooltip: {
trigger: 'item',
formatter: function (params) {
console.log(params)
const dataItem = gobalTempMapVoList.find(item => item.name.includes(params.name.substring(0, 2)));
if (dataItem) {
return `
<div class="tooltip">
<div class="tooltip-title">${dataItem.name}</div>
<div class="tooltip-content">
<ul class="tooltip-ul" >
<li>维权案件总数 <span>${dataItem.totalCase}</span></li>
<li>受侵害人数 <span>${dataItem.victimPer}</span></li>
<li>抚慰人数 <span>${dataItem.comfortPer}</span></li>
<li>打击处理人数 <span>${dataItem.hitPro}</span></li>
<li>抚慰金额 <span>${dataItem.comfortMon}</span></li>
</ul>
</div>
</div>`;
} else {
return `<div class="tooltip">
<div class="tooltip-title">${dataItem.name}</div>
<div class="tooltip-content">
<ul class="tooltip-ul"">
<li>维权案件数 <span>0</span></li>
<li>抚慰人数 <span>0</span></li>
</ul>
</div>
</div>`;
}
},
// backgroundColor: "#031577", //
// borderColor: "#0A2F86",
// borderWidth: 0, // 1
// borderRadius: 3, // 3
// shadowBlur: 0, // 8
// shadowOffsetX: 0, // 0
// shadowOffsetY: 0, // 6
},
visualMap: { visualMap: {
type: "piecewise", type: "piecewise",
bottom: 10, bottom: 10,
pieces: [ pieces: [
{gte: 85, lte: 100, label: "数据数高于1000"}, { min: 0, max: 500, label: "问题数低于500" }, { min: 501, max: 1000, label: "问题数介于500-1000" }, { min: 1001, label: "问题数高于1000" },
{gte: 65, lte: 85, label: "问题数低于1000"},
{gte: 0, lte: 65, label: "问题数低于500"},
], ],
right: 10, // right: 10,
realtime: false, realtime: false,
orient: "horizontal", // orient: "horizontal",
textStyle: { textStyle: {
color: "#fff", // color: "#fff",
}, },
calculable: true, calculable: true,
inRange: { inRange: {
color: ["#4987F6", "#F6A149", "#D34343"], color: ["#4987F6", "#F6A149", "#D34343",],
}, },
}, },
series: [ series: [
@ -198,23 +336,28 @@ const option = {
type: "map", type: "map",
map: "changsha", map: "changsha",
hoverAnimation: true, hoverAnimation: true,
emphasis: {
areaColor: "#FFD700", //
borderColor: "#FF0000", //
borderWidth: 4 //
},
label: { label: {
show: true, show: true,
color: "white", color: "white",
}, },
itemStyle: { itemStyle: {
normal: { normal: {
areaColor: "#02215E", // areaColor: "#02215E",
borderColor: "#1773c3",
}, },
}, },
emphasis: {
areaColor: "#FFD700", //
borderColor: "#FF0000", //
borderWidth: 4 //
}, },
data: gobalTempMapVoList.map(item => ({
name: item.name,
value: item.totalPro // totalPro value
}))
}
], ],
}; })
const option1 = ref({ const option1 = ref({
xAxis: { xAxis: {
@ -501,6 +644,108 @@ const colors = [
]; ];
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/datav.scss"; @import "@/style/datav.scss";
:deep() {
//
.tooltip {
position: relative;
width: 169.88px;
height: 170px;
background: linear-gradient(180deg, rgba(1, 4, 87, 0.8) 0%, rgba(3, 21, 119, 0.8) 100%);
border: 1px solid #4E8FFF;
margin: -10px -10px -10px -10px;
}
//
.tooltip-title {
width: 169.88px;
height: 43px;
background: linear-gradient(180deg, rgba(1, 4, 87, 0.8) 0%, rgba(3, 21, 119, 0.8) 100%);
display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
text-align: center; /* 水平居中 */
font-weight: 400;
font-size: 16px;
color: #FFFFFF;
line-height: 22px;
border-bottom: 1px solid #253755; /* 设置下边框 */
}
.tooltip-content {
width: 170px;
height: 132px;
//font-size: 11px;
margin-top: -12px;
background: linear-gradient(180deg, #010457 0%, #031577 100%);
}
.tooltip-content ul {
list-style-type: none; /* 移除默认的小圆点 */
padding: 0;
}
.tooltip-content ul li {
margin-left: 5px;
height: 25px;
color: #597AE9;
font-size: 13px;
}
// span
.tooltip-ul span {
float: right;
width: 50px;
text-align: right;
margin-right: 35px;
color: #fff;
font-size: 13px;
}
/* 小尖角 */
.tooltip::before {
content: '';
position: absolute;
top: 90px; /* 调整尖角的垂直位置 */
left: -10px; /* 调整尖角的水平位置 */
width: 0;
height: 0;
//border-top: 10px solid red; /* */
//border-bottom: 10px solid green; /* */
//border-right: 10px solid blue; /* */
}
}
.test {
width: 95px;
height: 25px;
background: #1C3472;
}
.gobal-dropdown-container {
position: absolute;
right: 20px;
top: 15px;
}
.my-gobal-yearselect {
font-size: 14px;
padding-top: 6px;
padding-left: 20px;
width: 90px;
color: #fff;
}
</style> </style>
Loading…
Cancel
Save