diff --git a/src/api/datav.ts b/src/api/datav.ts index 7265945..f6adeab 100644 --- a/src/api/datav.ts +++ b/src/api/datav.ts @@ -33,6 +33,32 @@ export function getRightsComfortData(times) { }); } + +/** + * 维权抚慰一级 维权案件情况 + * @param body + */ +export function getRightsBarList(body) { + return request.post({ + url: `/datav/rightsComfort/getRightsBarList`, + body + }); +} + + + +/** + * 维权抚慰一级 抚慰金额情况 + * @param body + */ +export function getComfortMoneyBarList(body) { + return request.post({ + url: `/datav/rightsComfort/getComfortMoneyBarList`, + body + }); +} + + export function getRecentlyMailTrend(query) { // alert(days + activeMailTrend.value) return request.get({ diff --git a/src/views/datav/RightsComfort.vue b/src/views/datav/RightsComfort.vue index eccb262..a1f2ecf 100644 --- a/src/views/datav/RightsComfort.vue +++ b/src/views/datav/RightsComfort.vue @@ -218,13 +218,11 @@ import * as echarts from "echarts/core"; import moment from "moment"; import { - getALlComfortCount, - getPunishmentSituation, - getComfortSituation, - getRightsAndComfortRank, getPoliceHurtSituationAndHurtType, getCaseAriseSituationRate, getComfortMapIcon + getPoliceHurtSituationAndHurtType, getCaseAriseSituationRate, getComfortMapIcon } from "@/api/screen/rightsComfort.ts"; import { - getRightsComfortData + getRightsComfortData, + getRightsBarList, getComfortMoneyBarList } from "@/api/datav"; @@ -385,21 +383,21 @@ const comfortInjuryCategory = ref( ////////////////////////////////////////////////////////////////////////////////////////////////// function getData() { + getRightsBarListFun(); + getComfortMoneyBarListFun(); getRightsComfortData(time.value).then(data => { - overview.value.rightsNumber = data.rightsNumber overview.value.victimNumber = data.victimNumber overview.value.hitPersonNumber = data.hitPersonNumber overview.value.comfortPersonNumber = data.comfortPersonNumber overview.value.comfortMoney = data.comfortMoney - - countyComfortMoneyBarList.value = data.countyComfortMoneyBarList; - bureauComfortMoneyBarList.value = data.bureauComfortMoneyBarList; + // countyComfortMoneyBarList.value = data.countyComfortMoneyBarList; + // bureauComfortMoneyBarList.value = data.bureauComfortMoneyBarList; punishmentSituationOption.value.series[0].data = data.punishmentSituation comfortPoliceInjurySituation.value.series[0].data = data.comfortPoliceInjurySituation comfortInjuryCategory.value.series[0].data = data.comfortInjuryCategory - countyRightsBarList.value = data.countyRightsBarList; - bureauRightsBarList.value=data.bureauRightsBarList; + // countyRightsBarList.value = data.countyRightsBarList; + // bureauRightsBarList.value=data.bureauRightsBarList; xsajCaseTypeOption.value.series[0].data = data.crownCaseBarList; xzajCaseTypeOption.value.series[0].data = data.administrativeCaseList; }) @@ -414,6 +412,26 @@ onMounted(() => { getData(); }); +const getRightsBarListFun = async() =>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1] + } + const res = await getRightsBarList(body); + countyRightsBarList.value = res.countyRightsBarList; + bureauRightsBarList.value = res.bureauRightsBarList; +} + + +const getComfortMoneyBarListFun = async() =>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1] + } + const res = await getComfortMoneyBarList(body); + countyComfortMoneyBarList.value = res.countyComfortMoneyBarList; + bureauComfortMoneyBarList.value = res.bureauComfortMoneyBarList; +} let globalTempMapVoList = ref([]); @@ -462,23 +480,26 @@ const getMapData = async (timeValue) => { return { ...item, originalName: setNameFun(item.name), // 添加原始名称 - name: item.name, - value: item.totalCase, + name: name, + value: item.rightsNumber, }; }); console.log('转换后数据:', mappedData); globalTempMapVoList.value = mappedData - const total = mappedData.reduce((sum, item) => sum + (Number(item.rightsNumber) || 0), 0); - const avg = total / mappedData.length; // 计算平均值 + const maxItem = mappedData.reduce( + (max, item) => (Number(item.rightsNumber) > Number(max.rightsNumber) ? item : max), + mappedData[0] + ); + const range60Percent = maxItem.rightsNumber * 0.6; + const range80Percent = maxItem.rightsNumber * 0.8; console.log('mappedData',mappedData) - const range30Percent = avg * 0.3 // 不用取整,小数也可以 option.value.series[0].data = mappedData; console.log('option series data:', option.value.series[0].data); option.value.visualMap.pieces = [ - {gte: 0, lte: avg - range30Percent, label: "低于平均问题30%", color: "#4987F6"}, - {gte: avg - range30Percent, lte: avg + range30Percent + 0.1, label: `平均问题上下浮动30%内`, color: "#F6A149"}, - {gte: avg + range30Percent, label: "高于平均问题30%", color: "#D34343"}, + {gte: 0, lte: range60Percent, label: "低于最大维权案件60%", color: "#4987F6"}, + {gte: range60Percent, lte: range80Percent, label: "介于最大维权案件60%~80%", color: "#F6A149"}, + {gte: range80Percent, label: "高于最大维权案件80%", color: "#D34343"}, ]; } @@ -527,6 +548,9 @@ echarts.registerMap("changsha", changshaMap); const option = ref({ geo: { map: "changsha", + itemStyle: { + opacity: 0, + }, }, tooltip: { trigger: 'item', @@ -582,22 +606,21 @@ const option = ref({ name: "长沙", type: "map", map: "changsha", - hoverAnimation: true, + roam: true, label: { show: true, color: "white", }, itemStyle: { - normal: { - areaColor: "#02215E", - borderColor: "#24D2EE", - borderWidth: 1 // 高亮时边框宽度 - }, + areaColor: "#02215E", + borderColor: "#24D2EE", + borderWidth: 1, + opacity: 1, }, emphasis: { - areaColor: "#FFD700", // 高亮时区域颜色 - borderColor: "#FF0000", // 高亮时边框颜色 - borderWidth: 4 // 高亮时边框宽度 + areaColor: "#FFD700", + borderColor: "#FF0000", + borderWidth: 4, }, data: [] }