From 8a24b8f3c36962b6f059c04ccbbcf58c1c4a4ec0 Mon Sep 17 00:00:00 2001 From: sjh Date: Sun, 17 Nov 2024 21:25:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=81=B5=E6=95=8F=E6=84=9F?= =?UTF-8?q?=E7=9F=A5=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data/risk.ts | 64 +++---- src/components/datav/tabs.vue | 3 + src/views/datav/Lmgz.vue | 297 ++++++++++++++++++++---------- src/views/datav/RightsComfort.vue | 16 +- 4 files changed, 239 insertions(+), 141 deletions(-) diff --git a/src/api/data/risk.ts b/src/api/data/risk.ts index f3cea26..f9156c4 100644 --- a/src/api/data/risk.ts +++ b/src/api/data/risk.ts @@ -1,99 +1,99 @@ import request from "@/api/request"; -export function totalStatistics() { +export function totalStatistics(times) { return request.get({ - url: `/datav/risk/total/statistics` + url: `/datav/risk/total/statistics?beginTime=${times[0]}&endTime=${times[1]}` }); } -export function areaRiskStatistics() { +export function areaRiskStatistics(times, type) { return request.get({ - url: `/datav/risk/area/risk/statistics` + url: `/datav/risk/area/risk/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function orgRiskStatistics() { +export function orgRiskStatistics(times, type) { return request.get({ - url: `/datav/risk/risk/org/statistics` + url: `/datav/risk/risk/org/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function orgCarRiskStatistics() { +export function orgCarRiskStatistics(times, type) { return request.get({ - url: `/datav/risk/risk/org/car/statistics` + url: `/datav/risk/risk/org/car/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function policeARiskStatistics() { +export function policeARiskStatistics(times, type) { return request.get({ - url: `/datav/risk/risk/police/a/statistics` + url: `/datav/risk/risk/police/a/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function policeBRiskStatistics() { +export function policeBRiskStatistics(times, type) { return request.get({ - url: `/datav/risk/risk/police/b/statistics` + url: `/datav/risk/risk/police/b/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function leaderRiskStatistics() { +export function leaderRiskStatistics(times, type) { return request.get({ - url: `/datav/risk/risk/leader/statistics` + url: `/datav/risk/risk/leader/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } // ******************************************* -export function areaNegativeStatistics() { +export function areaNegativeStatistics(times, type) { return request.get({ - url: `/datav/risk/area/negative/statistics` + url: `/datav/risk/area/negative/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function orgNegativeStatistics() { +export function orgNegativeStatistics(times, type) { return request.get({ - url: `/datav/risk/org/negative/statistics` + url: `/datav/risk/org/negative/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function orgCarNegativeStatistics() { +export function orgCarNegativeStatistics(times, type) { return request.get({ - url: `/datav/risk/org/car/negative/statistics` + url: `/datav/risk/org/car/negative/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function policeANegativeStatistics() { +export function policeANegativeStatistics(times, type) { return request.get({ - url: `/datav/risk/police/a/negative/statistics` + url: `/datav/risk/police/a/negative/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function policeBNegativeStatistics() { +export function policeBNegativeStatistics(times, type) { return request.get({ - url: `/datav/risk/police/b/negative/statistics` + url: `/datav/risk/police/b/negative/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function policeLeaderNegativeStatistics() { +export function policeLeaderNegativeStatistics(times, type) { return request.get({ - url: `/datav/risk/police/leader/negative/statistics` + url: `/datav/risk/police/leader/negative/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } // ******************************************* -export function areaRateStatistics() { +export function areaRateStatistics(times, type) { return request.get({ - url: `/datav/risk/area/rate/statistics` + url: `/datav/risk/area/rate/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function orgRateStatistics() { +export function orgRateStatistics(times, type) { return request.get({ - url: `/datav/risk/org/rate/statistics` + url: `/datav/risk/org/rate/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } -export function orgCarRateStatistics() { +export function orgCarRateStatistics(times, type) { return request.get({ - url: `/datav/risk/org/car/rate/statistics` + url: `/datav/risk/org/car/rate/statistics?beginTime=${times[0]}&endTime=${times[1]}&type=${type}` }); } diff --git a/src/components/datav/tabs.vue b/src/components/datav/tabs.vue index d46367a..23ee00b 100644 --- a/src/components/datav/tabs.vue +++ b/src/components/datav/tabs.vue @@ -112,6 +112,9 @@ function handleChangeActiveTab(name) { &:last-child { border-radius: 0 103px 103px 0; } + &:only-child { + border-radius: 103px; /* 当只有唯一一个元素时,设置所有四个角的圆角 */ + } } } diff --git a/src/views/datav/Lmgz.vue b/src/views/datav/Lmgz.vue index 8395c51..83762bc 100644 --- a/src/views/datav/Lmgz.vue +++ b/src/views/datav/Lmgz.vue @@ -9,9 +9,8 @@ 执法监督灵敏感知体系
- - 2024年01月01日 - 2024年08月30日 -
+ +
- + +
+ 分县市局 +
+ + + + + +
+
- + - + - +
- + +
+ 派出所 +
+ + + + + +
+
- + - + - +
- + +
+ 交警大队 +
+ + + + + +
+
- + - + - + - + +
+ 领导 +
+ + + + + +
+
- + - - - + +
- + +
+ 民警 +
+ + + + + +
+
- + - +
- - - - - - - - - - - - - - - + +
+ 协辅警 +
+ + + + + +
+
+ + + - - + + +
@@ -267,8 +317,13 @@ import { orgRateStatistics, orgCarRateStatistics } from '@/api/data/risk'; - - +import moment from "moment"; +let selectedMetric = ref('problemNumber'); +let selectedMetricPCS = ref('problemNumber'); +let selectedMetricJJDD = ref('problemNumber'); +let selectedMetricLD = ref('paichusuo'); +let selectedMetricMJ = ref('paichusuo'); +let selectedMetricXFJ = ref('paichusuo'); let statisticsTotal = ref({ caseTotal: 0, aTotal: 0, @@ -288,38 +343,57 @@ let orgNegativeList = ref([]) let orgCarNegativeList = ref([]) let policeANegativeList = ref([]) let policeBNegativeList = ref([]) -let leaderNegativeList = ref([ - {label: '1', value:123}, - {label: '2', value:42}, - {label: '3', value:33}, - {label: '4', value:12} -]) +let leaderNegativeList = ref([]) let areaRateList = ref([]) let orgRateList = ref([]) let orgCarRateList = ref([]) +const time = ref([ + moment().startOf("year").format("YYYY-MM-DD"), + moment().format("YYYY-MM-DD"), +]); + +watch([time, selectedMetric, selectedMetricPCS, selectedMetricJJDD, selectedMetricLD, selectedMetricMJ, selectedMetricXFJ], () => { + getTotalData();//数量统计 /total/statistics + getAreaRiskData(selectedMetric.value); // 【分县市局 高业务量】 + getAreaNegativeData(selectedMetric.value);// 分县 /area/negative/statistics 【分县市局 中业务量】 + getAreaRateData(selectedMetric.value);// /area/rate/statistics 【分县市局 低业务量】 + getPCSRiskData(selectedMetricPCS.value);//分机构统计风险分 派出所 /risk/org/statistics 【派出所 高业务量】 + getOrgNegativeData(selectedMetricPCS.value);// 派出所 /org/negative/statistics 【派出所 中业务量】 + getOrgRateData(selectedMetricPCS.value);// 派出所 /org/rate/statistics 【派出所 低业务量】 + getCarRiskData(selectedMetricJJDD.value);//分机构统计风险分 交警大队 【交警大队 高业务量】 + getCarOrgNegativeData(selectedMetricJJDD.value);// /org/car/negative/statistics 【交警大队 中业务量】 + getCarOrgRateData(selectedMetricJJDD.value);// 交警人均率 /org/car/rate/statistics 【交警大队 低业务量】 + getLeaderNegativeData(selectedMetricLD.value);// 【领导 问题数】 + getLeaderRiskData(selectedMetricLD.value);// 【领导 问题涉及人数】 + getPoliceANegativeData(selectedMetricMJ.value);// 【民警 问题数】 + getPoliceARiskData(selectedMetricMJ.value);// 【民警 问题发生率】 + // getPoliceBNegativeData(selectedMetricXFJ.value);//【辅警/协警 问题数】 + // getPoliceBRiskData(selectedMetricXFJ.value);//【辅警/协警 问题发生率】 +}); + onMounted(() => { - // getTotalData(); - // getAreaRiskData(); - // getPCSRiskData(); - // getCarRiskData() - // getPoliceARiskData(); - // getPoliceBRiskData(); - // getLeaderRiskData(); - // getLeaderNegativeData(); - // getPoliceBNegativeData(); - // getPoliceANegativeData(); - // getAreaNegativeData(); - // getCarOrgNegativeData(); - // getOrgNegativeData(); - // getAreaRateData(); - // getOrgRateData(); - // getCarOrgRateData(); + getTotalData();//数量统计 /total/statistics + getAreaRiskData(selectedMetric.value); // 【分县市局 高业务量】 + getAreaNegativeData(selectedMetric.value);// 分县 /area/negative/statistics 【分县市局 中业务量】 + getAreaRateData(selectedMetric.value);// /area/rate/statistics 【分县市局 低业务量】 + getPCSRiskData(selectedMetricPCS.value);//分机构统计风险分 派出所 /risk/org/statistics 【派出所 高业务量】 + getOrgNegativeData(selectedMetricPCS.value);// 派出所 /org/negative/statistics 【派出所 中业务量】 + getOrgRateData(selectedMetricPCS.value);// 派出所 /org/rate/statistics 【派出所 低业务量】 + getCarRiskData(selectedMetricJJDD.value);//分机构统计风险分 交警大队 【交警大队 高业务量】 + getCarOrgNegativeData(selectedMetricJJDD.value);// /org/car/negative/statistics 【交警大队 中业务量】 + getCarOrgRateData(selectedMetricJJDD.value);// 交警人均率 /org/car/rate/statistics 【交警大队 低业务量】 + getLeaderNegativeData(selectedMetricLD.value);// 【领导 问题数】 + getLeaderRiskData(selectedMetricLD.value);// 【领导 问题涉及人数】 + getPoliceANegativeData(selectedMetricMJ.value);// 【民警 问题数】 + getPoliceARiskData(selectedMetricMJ.value);// 【民警 问题发生率】 + // getPoliceBNegativeData(selectedMetricXFJ.value);//【辅警/协警 问题数】 + // getPoliceBRiskData(selectedMetricXFJ.value);//【辅警/协警 问题发生率】 }); const getTotalData = () => { - totalStatistics().then(res => { + totalStatistics(time.value).then(res => { statisticsTotal.value.aTotal = res.atotal == undefined ? 0 : res.atotal; statisticsTotal.value.caseTotal = res.caseTotal == undefined ? 0 : res.caseTotal; statisticsTotal.value.negativeTotal = res.negativeTotal == undefined ? 0 : res.negativeTotal; @@ -328,92 +402,92 @@ const getTotalData = () => { }) } -const getAreaRiskData = () => { - areaRiskStatistics().then(res => { +const getAreaRiskData = (type) => { + areaRiskStatistics(time.value, type).then(res => { areaRiskList.value = eachData(res) }) } -const getPCSRiskData = () => { - orgRiskStatistics().then(res => { +const getPCSRiskData = (type) => { + orgRiskStatistics(time.value, type).then(res => { pcsRiskList.value = eachData(res) }) } -const getCarRiskData = () => { - orgCarRiskStatistics().then(res => { +const getCarRiskData = (type) => { + orgCarRiskStatistics(time.value, type).then(res => { carRiskList.value = eachData(res) }) } -const getPoliceARiskData = () => { - policeARiskStatistics().then(res => { +const getPoliceARiskData = (type) => { + policeARiskStatistics(time.value, type).then(res => { policeARiskList.value = eachData(res) }) } -const getPoliceBRiskData = () => { - policeBRiskStatistics().then(res => { +const getPoliceBRiskData = (type) => { + policeBRiskStatistics(time.value, type).then(res => { policeBRiskList.value = eachData(res) }) } -const getLeaderRiskData = () => { - leaderRiskStatistics().then(res => { +const getLeaderRiskData = (type) => { + leaderRiskStatistics(time.value, type).then(res => { leaderRiskList.value = eachData(res) }) } -const getAreaNegativeData = () => { - areaNegativeStatistics().then(res => { +const getAreaNegativeData = (type) => { + areaNegativeStatistics(time.value, type).then(res => { areaNegativeList.value = res }) } -const getOrgNegativeData = () => { - orgNegativeStatistics().then(res => { +const getOrgNegativeData = (type) => { + orgNegativeStatistics(time.value, type).then(res => { orgNegativeList.value = res }) } -const getCarOrgNegativeData = () => { - orgCarNegativeStatistics().then(res => { +const getCarOrgNegativeData = (type) => { + orgCarNegativeStatistics(time.value, type).then(res => { orgCarNegativeList.value = res }) } -const getPoliceANegativeData = () => { - policeANegativeStatistics().then(res => { +const getPoliceANegativeData = (type) => { + policeANegativeStatistics(time.value, type).then(res => { policeANegativeList.value = res }) } -const getPoliceBNegativeData = () => { - policeBNegativeStatistics().then(res => { +const getPoliceBNegativeData = (type) => { + policeBNegativeStatistics(time.value, type).then(res => { policeBNegativeList.value = res }) } -const getLeaderNegativeData = () => { - policeLeaderNegativeStatistics().then(res => { +const getLeaderNegativeData = (type) => { + policeLeaderNegativeStatistics(time.value, type).then(res => { leaderNegativeList.value = res }) } -const getAreaRateData = () => { - areaRateStatistics().then(res => { +const getAreaRateData = (type) => { + areaRateStatistics(time.value, type).then(res => { areaRateList.value = eachData(res) }) } -const getOrgRateData = () => { - orgRateStatistics().then(res => { +const getOrgRateData = (type) => { + orgRateStatistics(time.value, type).then(res => { orgRateList.value = eachData(res) }) } -const getCarOrgRateData = () => { - orgCarRateStatistics().then(res => { +const getCarOrgRateData = (type) => { + orgCarRateStatistics(time.value, type).then(res => { orgCarRateList.value = eachData(res) }) } @@ -446,4 +520,25 @@ const colors = [ diff --git a/src/views/datav/RightsComfort.vue b/src/views/datav/RightsComfort.vue index a9f0860..934505b 100644 --- a/src/views/datav/RightsComfort.vue +++ b/src/views/datav/RightsComfort.vue @@ -151,14 +151,14 @@ const punishmentSituationList = ref([]); const comfortSituationList = ref([]); function getData() { - // getRightsComfortData(time.value).then((data) => { - // console.log('Received data:', data); // 添加日志输出 - // comfortPersonNumber.value = data.comfortPersonNumber; - // hitPersonNumber.value = data.hitPersonNumber; - // comfortMoney.value = data.comfortMoney; - // punishmentSituationList.value = data.punishmentSituation; - // comfortSituationList.value = data.comfortSituation; - // }); + getRightsComfortData(time.value).then((data) => { + console.log('Received data:', data); // 添加日志输出 + comfortPersonNumber.value = data.comfortPersonNumber; + hitPersonNumber.value = data.hitPersonNumber; + comfortMoney.value = data.comfortMoney; + punishmentSituationList.value = data.punishmentSituation; + comfortSituationList.value = data.comfortSituation; + }); } watch(time, () => {