diff --git a/src/api/screen/subScreen/subOneRightsConfort.ts b/src/api/screen/subScreen/subOneRightsConfort.ts index 7e6b9a3..2376861 100644 --- a/src/api/screen/subScreen/subOneRightsConfort.ts +++ b/src/api/screen/subScreen/subOneRightsConfort.ts @@ -1,47 +1,88 @@ import request from "@/api/request"; +/** + * 维权抚慰二级 维权案件情况 + * @param body + */ +export function getSubRightsBarList(body) { + return request.post({ + url: `/datav/sub1/rightsComfort/getSubRightsBarList`, + body + }); +} -export function getSubOneALlComfortCount(departId, times) { - return request.get({ - url: `/datav/sub1/rightsComfort/getSubOneALlComfortCount?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` + +/** + * 维权抚慰二级 抚慰金情况 + * @param body + */ +export function getSubComfortMoneyBarList(body) { + return request.post({ + url: `/datav/sub1/rightsComfort/getSubComfortMoneyBarList`, + body + }); +} +/** + * 维权抚慰二级 案件类别占比 + * @param body + */ +export function getSubCaseType(body) { + return request.post({ + url: `/datav/sub1/rightsComfort/getSubCaseType`, + body }); } -export function getSubOnePoliceHurtSituationAndHurtType(departId, times) { - return request.get({ - url: `/datav/sub1/rightsComfort/getSubOnePoliceHurtSituationAndHurtType?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` +/** + * 维权抚慰二级 总览 + * @param body + */ +export function getSubOneALlComfortCount(body) { + return request.post({ + url: `/datav/sub1/rightsComfort/getSubOneALlComfortCount`, + body }); } +/** + * 打处情况 + * @param body + */ +export function getSubHitState(body) { + return request.post({ + url: `/datav/sub1/rightsComfort/getSubHitState`, + body + }); +} -export function getSubOneCaseAriseSituationRate(departId, times) { - return request.get({ - url: `/datav/sub1/rightsComfort/getSubOneCaseAriseSituationRate?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` +export function getSubComfortState(body) { + return request.post({ + url: `/datav/sub1/rightsComfort/getSubComfortState`, + body }); } -//抚慰情况 -export function getComfortSituation(departId,times){ - return request.get({ - url:`/datav/sub1/rightsComfort/getComfortSituation?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` - }) -} -//案件类别占比 -export function getSubCaseType(departId,times){ - return request.get({ - url:`/datav/sub1/rightsComfort/getSubCaseType?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` - }) +export function getSubPoliceHurtSituationAndHurtType(body) { + return request.post({ + url: `/datav/sub1/rightsComfort/getSubPoliceHurtSituationAndHurtType`, + body + }); } -//打处情况 -export function getPunishmentSituation(departId,times){ - return request.get({ - url:`/datav/sub1/rightsComfort/getPunishmentSituation?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` - }) + + +export function getSubOneCaseAriseSituationRate(body) { + return request.post({ + url: `/datav/sub1/rightsComfort/getSubOneCaseAriseSituationRate`, + body + }); } + + + //获取地图数据 export function getSubComfortMapIcon(departId,times){ return request.get({ diff --git a/src/views/datav/subonedatav/SubOneRightsComfort.vue b/src/views/datav/subonedatav/SubOneRightsComfort.vue index 26369e1..0098da5 100644 --- a/src/views/datav/subonedatav/SubOneRightsComfort.vue +++ b/src/views/datav/subonedatav/SubOneRightsComfort.vue @@ -219,12 +219,15 @@ import moment from "moment"; import {getSubOneStreetMap} from "@/api/screen/subScreen/subOneGlobal.ts"; import { - getSubOneALlComfortCount, getSubOneCaseAriseSituationRate, - getSubOnePoliceHurtSituationAndHurtType, - getComfortSituation, - getSubCaseType, - getPunishmentSituation, - getSubComfortMapIcon + getSubOneALlComfortCount, + getSubOneCaseAriseSituationRate, + getSubComfortMapIcon, + getSubRightsBarList, + getSubHitState, + getSubComfortState, + getSubPoliceHurtSituationAndHurtType, + getSubComfortMoneyBarList, + getSubCaseType } from "@/api/screen/subScreen/subOneRightsConfort.ts"; import SubOneHeader from "@/components/datav/subOne/subOneHeader.vue"; import useUserStore from "@/stores/modules/user"; @@ -355,145 +358,121 @@ const getMapJSON = async (departId) => { } // 维权案件情况 -const getRightsRankList = async (departId, timeValue) => { - const res = await getSubOneALlComfortCount(departId, timeValue); +const getSubRightsBarListFun = async () => { + const body = { + beginTime: time.value[0], + endTime: time.value[1], + departId: currentDepartId + } + const res = await getSubRightsBarList(body); fxsjRightsRank.value = res.fxsjRightsRankList; jsdwRightsRank.value = res.jsdwRightsRankList; +} +// 抚慰金额情况 +const getSubComfortMoneyBarListFun = async ()=>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1], + departId: currentDepartId + } + const res = await getSubComfortMoneyBarList(body); + fxsjComfortMoneyRank.value = res.fxsjComfortMoneyRank; + jsdwComfortMoneyRank.value = res.jsdwComfortMoneyRank; +} +const getSubCaseTypeFun = async ()=>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1], + departId: currentDepartId + } + const res = await getSubCaseType(body); + xsajCaseTypeOption.value.series[0].data =res.crownCaseBar; + xzajCaseTypeOption.value.series[0].data =res.administrativeCase; +} +// 总览数据 +const getSubOneALlComfortCountFun = async ()=>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1], + departId: currentDepartId + } + const res = await getSubOneALlComfortCount(body); comfortOverview.value=res.comfortOverview; - fxsjComfortMoneyRank.value =res.fxsjComfortMoneyRank; - jsdwComfortMoneyRank.value =res.jsdwComfortMoneyRank; + } -// 中央总览 -// const getComfortOverview = async (timeValue) => { -// const res = await getALlComfortCount(timeValue); -// comfortOverview.value = res.comfortOverview; -// } -// 地图数据 -// const getMapData = async (timeValue) => { -// const res = await getComfortMapIcon(timeValue); -// const mappedData = res.comfortMapVoList.map(item => { -// let name; -// switch (item.name) { -// case '长沙县局': -// name = '长沙县'; -// break; -// case '芙蓉分局': -// name = '芙蓉区'; -// break; -// case '天心分局': -// name = '天心区'; -// break; -// case '岳麓分局': -// name = '岳麓区'; -// break; -// case '开福分局': -// name = '开福区'; -// break; -// case '雨花分局': -// name = '雨花区'; -// break; -// case '望城分局': -// name = '望城区'; -// break; -// case '宁乡市局': -// name = '宁乡市'; -// break; -// case '浏阳市局': -// name = '浏阳市'; -// break; -// case '高新分局': -// name = '高新区'; -// break; -// default: -// name = item.name; -// break; -// } -// return { -// ...item, -// originalName: item.name, // 添加原始名称 -// name: name, -// value: item.totalCase, -// }; -// }); -// globalTempMapVoList.value = mappedData -// console.log(globalTempMapVoList) -// const total = mappedData.reduce((sum, item) => sum + Number(item.value), 0); -// const avg = total / mappedData.length; // 计算平均值 -// const range30Percent = avg * 0.3 // 不用取整,小数也可以 -// option.value.series[0].data = mappedData; -// 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"}, -// ]; -// } -//打处情况 -// const getPunishmentSituationList = async (timeValue) => { -// const res = await getPunishmentSituation(timeValue); -// punishmentSituationOption.series[0].data = res.punishmentSituationList; -// } -// //抚慰情况 -// const getComfortSituationList = async (timeValue) => { -// const res = await getComfortSituation(timeValue); -// comfortSituationOption.series[0].data = res.comfortSituationList; -// } - -// 民辅警受伤情况-受伤人数 -const getPoliceHurtSituationList = async (departId, timeValue) => { - const res = await getSubOnePoliceHurtSituationAndHurtType(departId, timeValue); - hurtNumOption.value.series[0].data = res.policeHurtSituationList - hurtTypeOption.value.series[0].data = res.policeHurtTypeList +// 打处情况 +const getSubHitStateFun = async ()=>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1], + departId: currentDepartId + } + const res = await getSubHitState(body); + punishmentSituationOption.value.series[0].data = res.PunishmentSituation +} +// 抚慰情况 +const getSubComfortStateFun = async ()=>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1], + departId: currentDepartId + } + const res = await getSubComfortState(body); + comfortSituationOption.value.series[0].data = res.comfortSituationList } -const getCaseAriseSituationRateList = async (departId, timeValue) => { - const res = await getSubOneCaseAriseSituationRate(departId, timeValue); +//受伤情况 +const getSubPoliceHurtSituationAndHurtTypeFun= async ()=>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1], + departId: currentDepartId + } + const res = await getSubPoliceHurtSituationAndHurtType(body); + hurtTypeOption.value.series[0].data = res.policeHurtSituationList +} + +const getSubOneCaseAriseSituationRateFun = async () => { + const body = { + beginTime: time.value[0], + endTime: time.value[1], + departId: currentDepartId + } + const res = await getSubOneCaseAriseSituationRate(body); ariseCaseLinkOption.value.series[0].data = res.incidentLinkList ariseCasePoliceOption.value.series[0].data = res.incidentPoliceTypeList ariseCaseORgOption.value.series[0].data = res.incidentOrgList } -//获取抚慰情况 -const getComfortSituationFun =async (departId, timeValue)=>{ - const res = await getComfortSituation(departId,timeValue); - console.log("获取抚慰情况",res) - comfortSituationOption.value.series[0].data = res.comfortSituationList; - -} -//获取案件类别占比 -const getSubCaseTypeFun = async (departId,timeValue)=>{ - const res = await getSubCaseType(departId,timeValue); - console.log("获取案件类别占比",res) - xsajCaseTypeOption.value.series[0].data=res.crownCaseBar - xzajCaseTypeOption.value.series[0].data=res.administrativeCase -} - -//打处情况 -const getPunishmentSituationFun = async (departId,timeValue) =>{ - const res = await getPunishmentSituation(departId,timeValue); - console.log("打处情况",res) - punishmentSituationOption.value.series[0].data = res.PunishmentSituation -} - //获取地图数据 const getMapData = async (departId, times) => { const res = await getSubComfortMapIcon(departId, times); console.log('getMapData',res) - if(res && res.comfortMapVoList){ - const mappedData = res.comfortMapVoList.map(item => { - return { - ...item, - value: item.totalPro, - }; - }); - const total = mappedData.reduce((sum, item) => sum + Number(item.value), 0); - const avg = total / mappedData.length; // 计算平均值 - const range30Percent = avg * 0.3 // 不用取整,小数也可以 + // 添加模拟数据 + if (res?.comfortMapVoList) { + const mappedData = res.comfortMapVoList.map(item => ({ + ...item, + value: Number(item.rightsNumber ?? 0), // ✅ 用 rightsNumber 控制颜色 + })); + + if (!mappedData.length) { + option.value.visualMap.pieces = []; + option.value.series[0].data = []; + globalTempMapVoList.value = []; + return; + } + + const total = mappedData.reduce((sum, item) => sum + item.value, 0); + const avg = total / mappedData.length; + const range30Percent = avg * 0.3; + option.value.visualMap.pieces = [ - {gte: 0, lte: avg - range30Percent, label: "低于平均问题30%", color: "#4987F6"}, - {gte: avg - range30Percent, lte: avg + range30Percent, label: "平均问题上下浮动30%内", color: "#F6A149"}, - {gte: avg + range30Percent, label: "高于平均问题30%", color: "#D34343"}, + { gte: 0, lte: avg - range30Percent, label: "低于平均30%", color: "#4987F6" }, + { gte: avg - range30Percent, lte: avg + range30Percent, label: "平均±30%", color: "#F6A149" }, + { gte: avg + range30Percent, label: "高于平均30%", color: "#D34343" }, ]; + globalTempMapVoList.value = mappedData; option.value.series[0].data = mappedData; } @@ -503,15 +482,30 @@ const getMapData = async (departId, times) => { // endregion function getData() { - getRightsRankList(currentDepartId, time.value); - // getComfortOverview(time.value); + // 维权案件情况 + getSubRightsBarListFun(); + // 抚慰金额情况 + getSubComfortMoneyBarListFun(); + // 案件类别占比 + getSubCaseTypeFun(); + // 中央总览 + getSubOneALlComfortCountFun(); + // 打处情况 + getSubHitStateFun(); + // 抚慰情况 + getSubComfortStateFun(); + // 民辅警受伤情况 + getSubPoliceHurtSituationAndHurtTypeFun(); + // 发案情况占比 + getSubOneCaseAriseSituationRateFun(); + // 地图卡片数据 getMapData(currentDepartId,time.value) // getPunishmentSituationList(time.value); - getPunishmentSituationFun(currentDepartId,time.value); - getComfortSituationFun(currentDepartId,time.value) - getSubCaseTypeFun(currentDepartId,time.value); - getPoliceHurtSituationList(currentDepartId, time.value); - getCaseAriseSituationRateList(currentDepartId, time.value); + // getPunishmentSituationFun(currentDepartId,time.value); + // getComfortSituationFun(currentDepartId,time.value) + // getSubCaseTypeFun(currentDepartId,time.value); + // getPoliceHurtSituationList(currentDepartId, time.value); + } watch(time, () => { @@ -543,6 +537,9 @@ echarts.registerMap("changsha", changshaMap); const option = ref({ geo: { map: "changsha", + itemStyle: { + opacity: 0, + }, }, tooltip: { trigger: 'item', @@ -552,7 +549,7 @@ const option = ref({ if (dataItem) { return `
-
${dataItem.name}
+
${params.name}