|
|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
<datav-card title="分县市局排名" subTitle="案件数"> |
|
|
|
|
<datav-tabs |
|
|
|
|
type="bottom-button" |
|
|
|
|
v-model="caseCountRankTab" |
|
|
|
|
> |
|
|
|
|
<datav-tab-item label="分县市局" name="1"> |
|
|
|
|
<el-scrollbar height="350px"> |
|
|
|
|
@ -96,12 +97,14 @@
|
|
|
|
|
:option="option" |
|
|
|
|
autoresize |
|
|
|
|
@click="handleClick" |
|
|
|
|
ref="caseVerifMap" |
|
|
|
|
/> |
|
|
|
|
<datav-card title="查处问题趋势"> |
|
|
|
|
<v-charts |
|
|
|
|
style="height: 320px" |
|
|
|
|
:option="proTrend" |
|
|
|
|
autoresize |
|
|
|
|
ref="caseVerifProTrend" |
|
|
|
|
/> |
|
|
|
|
<div class="gobal-dropdown-container"> |
|
|
|
|
<el-dropdown class="test" @command="handleCommand"> |
|
|
|
|
@ -175,7 +178,15 @@ import vCharts from "vue-echarts";
|
|
|
|
|
import changshaMap from "@/assets/data/changsha.json"; |
|
|
|
|
import * as echarts from "echarts/core"; |
|
|
|
|
import moment from "moment"; |
|
|
|
|
import {getAllCaseVerificationCount, getCaseVerificationRank, getCaseVerificationTrend, getCaseSourceRateAndDealSituation, getCaseVerificationMap, getCaseProblemProperty, getConfinementAndPause} from "@/api/screen/CaseVerif.ts"; |
|
|
|
|
import { |
|
|
|
|
getCaseVerificationRank, |
|
|
|
|
getCaseVerificationTrend, |
|
|
|
|
getCaseSourceRateAndDealSituation, |
|
|
|
|
getCaseVerificationMap, |
|
|
|
|
getCaseProblemProperty, |
|
|
|
|
getConfinementAndPause, |
|
|
|
|
getCaseVerificationCount |
|
|
|
|
} from "@/api/screen/caseVerif.ts"; |
|
|
|
|
|
|
|
|
|
const currentYear = new Date().getFullYear(); |
|
|
|
|
const years = ref([currentYear.toString(), (currentYear - 1).toString(), (currentYear - 2).toString()]); // 年份列表 |
|
|
|
|
@ -184,9 +195,6 @@ const time = ref([
|
|
|
|
|
moment().startOf("year").format("YYYY-MM-DD"), |
|
|
|
|
moment().format("YYYY-MM-DD"), |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const fxsjBarList = ref([]); |
|
|
|
|
const jsdwBarList = ref([]); |
|
|
|
|
const router = useRouter(); |
|
|
|
|
@ -198,143 +206,30 @@ const overview = ref({
|
|
|
|
|
punishOrg: 0, // 问责单位数、 |
|
|
|
|
Rate: 0, // 查实率 |
|
|
|
|
}); |
|
|
|
|
let gobalTempMapVoList = ref([]); |
|
|
|
|
|
|
|
|
|
const jjjgPieList = ref([]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// region 事件||监听 |
|
|
|
|
const handleCommand = (year) => { |
|
|
|
|
selectedYear.value = year; // 更新当前选中的年份 |
|
|
|
|
getProTrendList(selectedYear.value); |
|
|
|
|
}; |
|
|
|
|
watch(time, () => { |
|
|
|
|
getData(); |
|
|
|
|
}); |
|
|
|
|
// endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// region 所有函数 |
|
|
|
|
const getRankList = async(timeValue) => { |
|
|
|
|
const res = await getCaseVerificationRank(timeValue); |
|
|
|
|
fxsjBarList.value = res.fxsjRankList |
|
|
|
|
jsdwBarList.value = res.jsdwRankList |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const getCaseProblemPropertyList = async(timeValue) => { |
|
|
|
|
const res = await getCaseProblemProperty(timeValue); |
|
|
|
|
zfbaPieOption.value.series[0].data = res.zfbaPieList; |
|
|
|
|
fwglPieOption.value.series[0].data = res.fwglPieList; |
|
|
|
|
} |
|
|
|
|
const getOverview = async(timeValue)=>{ |
|
|
|
|
const res = await getAllCaseVerificationCount(timeValue) |
|
|
|
|
overview.value = res.overview |
|
|
|
|
} |
|
|
|
|
const getMapIcon = async(timeValue)=> { |
|
|
|
|
const res = await getCaseVerificationMap(timeValue); |
|
|
|
|
const mappedData = res.caseVerificationMapList.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.total, |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
gobalTempMapVoList.value = mappedData |
|
|
|
|
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 getProTrendList= async(year) => { |
|
|
|
|
const res = await getCaseVerificationTrend(year); |
|
|
|
|
const temp = res.proTrendList; |
|
|
|
|
const categories = temp.map(item => item.name); |
|
|
|
|
const values = temp.map(item => item.value); |
|
|
|
|
proTrend.value.xAxis.data = categories; |
|
|
|
|
proTrend.value.series[0].data = values; |
|
|
|
|
} |
|
|
|
|
const getCaseSourceAndDeal = async (timeValue)=>{ |
|
|
|
|
const res = await getCaseSourceRateAndDealSituation(timeValue); |
|
|
|
|
ajlyPieOption.value.series[0].data = res.caseSourceRateList |
|
|
|
|
wzclPieOption.value.series[0].data = res.dealSituationPieList |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const getConfinementAndPauseList = async (timeValue)=>{ |
|
|
|
|
const res = await getConfinementAndPause(timeValue); |
|
|
|
|
jbcloption.value.series[0].data = res.jbclList; |
|
|
|
|
tzcloption.value.series[0].data = res.dzclList; |
|
|
|
|
} |
|
|
|
|
// endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getData() { |
|
|
|
|
getRankList(time.value); |
|
|
|
|
getCaseProblemPropertyList(time.value) |
|
|
|
|
getOverview(time.value); |
|
|
|
|
getMapIcon(time.value); |
|
|
|
|
getProTrendList(selectedYear.value); |
|
|
|
|
getCaseSourceAndDeal(time.value); |
|
|
|
|
getConfinementAndPauseList(time.value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
watch(time, () => { |
|
|
|
|
getData(); |
|
|
|
|
}); |
|
|
|
|
onMounted(() => { |
|
|
|
|
getData(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let globalTempMapVoList = ref([]); |
|
|
|
|
|
|
|
|
|
const caseCountRankTab = ref('1') |
|
|
|
|
const caseVerifMap = ref(null); |
|
|
|
|
const caseVerifProTrend = ref(null); |
|
|
|
|
let caseVerifMapIntervalId; |
|
|
|
|
let caseVerifTrendIntervalId; |
|
|
|
|
let caseCountRankIntervalId; |
|
|
|
|
const colors = [ |
|
|
|
|
{ |
|
|
|
|
color: "linear-gradient( 270deg, #FB002D 0%, #822232 100%)", |
|
|
|
|
percentage: 80, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
color: "linear-gradient( 270deg, #FFB90E 0%, #71501D 100%)", |
|
|
|
|
percentage: 60, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
color: "linear-gradient( 270deg, #63E700 0%, #19674C 100%)", |
|
|
|
|
percentage: 40, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
// region 所有图表 |
|
|
|
|
echarts.registerMap("changsha", changshaMap); |
|
|
|
|
const option = ref({ |
|
|
|
|
geo: { |
|
|
|
|
@ -348,10 +243,11 @@ const option = ref({
|
|
|
|
|
}, |
|
|
|
|
tooltip: { |
|
|
|
|
trigger: 'item', |
|
|
|
|
position: 'bottom', |
|
|
|
|
formatter: function (params) { |
|
|
|
|
console.log(params) |
|
|
|
|
const dataItem = gobalTempMapVoList.value.find(item => item.name.includes(params.name.substring(0, 2))); |
|
|
|
|
if (dataItem ) { |
|
|
|
|
const dataItem = globalTempMapVoList.value.find(item => item.name.includes(params.name.substring(0, 2))); |
|
|
|
|
if (dataItem) { |
|
|
|
|
return ` |
|
|
|
|
<div class="tooltip"> |
|
|
|
|
<div class="tooltip-title">${dataItem.originalName}</div> |
|
|
|
|
@ -405,7 +301,7 @@ const option = ref({
|
|
|
|
|
}, |
|
|
|
|
calculable: true, |
|
|
|
|
inRange: { |
|
|
|
|
color: ["#4987F6","#F6A149", "#D34343" ], |
|
|
|
|
color: ["#4987F6", "#F6A149", "#D34343"], |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
series: [ |
|
|
|
|
@ -443,7 +339,7 @@ const proTrend = ref({
|
|
|
|
|
// 去掉X轴刻度线 |
|
|
|
|
show: false |
|
|
|
|
}, |
|
|
|
|
data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月'], |
|
|
|
|
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月'], |
|
|
|
|
}, |
|
|
|
|
yAxis: { |
|
|
|
|
type: "value", |
|
|
|
|
@ -615,8 +511,169 @@ const tzcloption = ref({
|
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
|
// endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// region 所有函数 |
|
|
|
|
const getCaseVerificationRankData = async (timeValue) => { |
|
|
|
|
const res = await getCaseVerificationRank(timeValue); |
|
|
|
|
fxsjBarList.value = res.fxsjRankList |
|
|
|
|
jsdwBarList.value = res.jsdwRankList |
|
|
|
|
} |
|
|
|
|
const getCaseProblemPropertyData = async (timeValue) => { |
|
|
|
|
const res = await getCaseProblemProperty(timeValue); |
|
|
|
|
zfbaPieOption.value.series[0].data = res.zfbaPieList; |
|
|
|
|
fwglPieOption.value.series[0].data = res.fwglPieList; |
|
|
|
|
} |
|
|
|
|
const getCaseVerificationCountData = async (timeValue) => { |
|
|
|
|
const res = await getCaseVerificationCount(timeValue) |
|
|
|
|
overview.value = res.overview |
|
|
|
|
} |
|
|
|
|
const getCaseVerificationMapData = async (timeValue) => { |
|
|
|
|
const res = await getCaseVerificationMap(timeValue); |
|
|
|
|
const mappedData = res.caseVerificationMapList.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.total, |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
globalTempMapVoList.value = mappedData |
|
|
|
|
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 getCaseVerificationTrendData = async (year) => { |
|
|
|
|
const res = await getCaseVerificationTrend(year); |
|
|
|
|
const temp = res.proTrendList; |
|
|
|
|
const categories = temp.map(item => item.name); |
|
|
|
|
const values = temp.map(item => item.value); |
|
|
|
|
proTrend.value.xAxis.data = categories; |
|
|
|
|
proTrend.value.series[0].data = values; |
|
|
|
|
} |
|
|
|
|
const getCaseSourceRateAndDealSituationData = async (timeValue) => { |
|
|
|
|
const res = await getCaseSourceRateAndDealSituation(timeValue); |
|
|
|
|
ajlyPieOption.value.series[0].data = res.caseSourceRateList |
|
|
|
|
wzclPieOption.value.series[0].data = res.dealSituationPieList |
|
|
|
|
} |
|
|
|
|
const getConfinementAndPauseData = async (timeValue) => { |
|
|
|
|
const res = await getConfinementAndPause(timeValue); |
|
|
|
|
jbcloption.value.series[0].data = res.jbclList; |
|
|
|
|
tzcloption.value.series[0].data = res.dzclList; |
|
|
|
|
} |
|
|
|
|
function getData() { |
|
|
|
|
getCaseVerificationRankData(time.value); |
|
|
|
|
getCaseProblemPropertyData(time.value) |
|
|
|
|
getCaseVerificationCountData(time.value); |
|
|
|
|
getCaseVerificationMapData(time.value); |
|
|
|
|
getCaseVerificationTrendData(selectedYear.value); |
|
|
|
|
getCaseSourceRateAndDealSituationData(time.value); |
|
|
|
|
getConfinementAndPauseData(time.value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 分县市局排名动画 |
|
|
|
|
const caseCountRankAnimation = () => { |
|
|
|
|
caseCountRankTab.value = (parseInt(caseCountRankTab.value) % 2 + 1).toString(); |
|
|
|
|
}; |
|
|
|
|
caseCountRankIntervalId = setInterval(caseCountRankAnimation, 2000); |
|
|
|
|
|
|
|
|
|
// 地图动画 |
|
|
|
|
const caseVerifMapAnimation = () => { |
|
|
|
|
const myCaseVerifMap = caseVerifMap?.value?.chart; |
|
|
|
|
if (!myCaseVerifMap) return; |
|
|
|
|
// 来个随机数,9个图 0~8的整数就ok |
|
|
|
|
const randomNum = Math.floor(Math.random() * 9); |
|
|
|
|
myCaseVerifMap.dispatchAction({ |
|
|
|
|
type: "downplay", //downplay 取消高亮 |
|
|
|
|
seriesIndex: 0, |
|
|
|
|
}); |
|
|
|
|
myCaseVerifMap.dispatchAction({ |
|
|
|
|
type: "highlight", //highLight 高亮指定的数据图形 |
|
|
|
|
seriesIndex: 0, //系列index |
|
|
|
|
dataIndex: randomNum, //数据index |
|
|
|
|
}); |
|
|
|
|
myCaseVerifMap.dispatchAction({ |
|
|
|
|
type: "showTip", //showTip 显示提示框 |
|
|
|
|
seriesIndex: 0, |
|
|
|
|
dataIndex: randomNum, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// 启动定时器,每隔 2 秒执行一次 |
|
|
|
|
caseVerifMapIntervalId = setInterval(caseVerifMapAnimation, 2000); |
|
|
|
|
|
|
|
|
|
// 问题趋势动画 |
|
|
|
|
const CaseVerifTrendAnimation = () => { |
|
|
|
|
const myCaseVerifProTrend = caseVerifProTrend.value.chart; |
|
|
|
|
if (!myCaseVerifProTrend) return; |
|
|
|
|
const randomNum = Math.floor(Math.random() * 12); |
|
|
|
|
myCaseVerifProTrend.dispatchAction({ |
|
|
|
|
type: 'showTip', |
|
|
|
|
seriesIndex: 0, |
|
|
|
|
dataIndex: randomNum, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
caseVerifTrendIntervalId = setInterval(CaseVerifTrendAnimation, 2000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
getData(); |
|
|
|
|
caseCountRankAnimation() |
|
|
|
|
setupEventListeners(); |
|
|
|
|
}); |
|
|
|
|
// endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// region 事件||监听 |
|
|
|
|
const handleCommand = (year) => { |
|
|
|
|
selectedYear.value = year; // 更新当前选中的年份 |
|
|
|
|
getCaseVerificationTrendData(selectedYear.value); |
|
|
|
|
}; |
|
|
|
|
watch(time, () => { |
|
|
|
|
getData(); |
|
|
|
|
}); |
|
|
|
|
const handleClick = (params) => { |
|
|
|
|
const departId = params.data.departId; |
|
|
|
|
const url = router.resolve({ |
|
|
|
|
@ -625,26 +682,22 @@ const handleClick = (params) => {
|
|
|
|
|
}).href; |
|
|
|
|
window.open(url, "_blank"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const colors = [ |
|
|
|
|
{ |
|
|
|
|
color: "linear-gradient( 270deg, #FB002D 0%, #822232 100%)", |
|
|
|
|
percentage: 80, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
color: "linear-gradient( 270deg, #FFB90E 0%, #71501D 100%)", |
|
|
|
|
percentage: 60, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
color: "linear-gradient( 270deg, #63E700 0%, #19674C 100%)", |
|
|
|
|
percentage: 40, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const setupEventListeners = () => { |
|
|
|
|
const myCaseVerifMap = caseVerifMap?.value?.chart; |
|
|
|
|
// 鼠标移入 |
|
|
|
|
myCaseVerifMap.on('mousemove', (e) => { |
|
|
|
|
clearInterval(caseVerifMapIntervalId); |
|
|
|
|
myCaseVerifMap.dispatchAction({type: "downplay", seriesIndex: 0,}); |
|
|
|
|
myCaseVerifMap.dispatchAction({type: "highlight", seriesIndex: 0, dataIndex: e.dataIndex,}); |
|
|
|
|
myCaseVerifMap.dispatchAction({type: "showTip", seriesIndex: 0, dataIndex: e.dataIndex,}); |
|
|
|
|
}); |
|
|
|
|
// 鼠标移出 |
|
|
|
|
myCaseVerifMap.on('mouseout', () => { |
|
|
|
|
clearInterval(caseVerifMapIntervalId); // 确保没有多个定时器同时运行 |
|
|
|
|
caseVerifMapIntervalId = setInterval(caseVerifMapAnimation, 2000); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
// endregion |
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
@ -728,6 +781,7 @@ const colors = [
|
|
|
|
|
right: 20px; |
|
|
|
|
top: 15px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.test { |
|
|
|
|
width: 95px; |
|
|
|
|
height: 25px; |
|
|
|
|
|