Browse Source

视频督察二级大屏

main
不爱学习的石同学 12 months ago
parent
commit
ac4076878f
  1. 5
      src/api/screen/mail.ts
  2. 16
      src/api/screen/sub1.ts
  3. 21
      src/api/screen/subScreen/videoSupervise.ts
  4. 4
      src/router/routes.ts
  5. 75
      src/views/datav/MailVisits.vue
  6. 3
      src/views/datav/SceneInsp.vue
  7. 96
      src/views/datav/Sub1.vue
  8. 12
      src/views/datav/VideoInsp.vue
  9. 723
      src/views/datav/subonedatav/SubOneVideoInsp.vue

5
src/api/screen/mail.ts

@ -16,6 +16,11 @@ export function getAllMailCount(times) {
}); });
} }
export function getMailMapIcon(times) {
return request.get({
url: `/datav/mailVisits/getMailMapIcon?beginTime=${times[0]}&endTime=${times[1]}`
});
}
export function getMailTrend(year) { export function getMailTrend(year) {
return request.get({ return request.get({

16
src/api/screen/sub1.ts

@ -7,6 +7,18 @@ export function getSubOneStreetMap(departPId) {
} }
export function getSubOneSupervisionRank(departPId, times) {
return request.get({
url: `/datav/sub1/getSubOneSupervisionRank?departPId=${departPId}&beginTime=${times[0]}&endTime=${times[1]}`
});
}
export function getSubOneOverView(departPId, times) {
return request.get({
url: `/datav/sub1/getSubOneOverView?departPId=${departPId}&beginTime=${times[0]}&endTime=${times[1]}`
});
}
export function getSubOneTrend(departPId, year) { export function getSubOneTrend(departPId, year) {
return request.get({ return request.get({
@ -15,8 +27,8 @@ export function getSubOneTrend(departPId, year) {
} }
export function getCaseVerifyRank(departPId, times) { export function getSubOneCaseVerifyRank(departPId, times) {
return request.get({ return request.get({
url: `/datav/sub1/getCaseVerifyRank?departPId=${departPId}&beginTime=${times[0]}&endTime=${times[1]}` url: `/datav/sub1/getSubOneCaseVerifyRank?departPId=${departPId}&beginTime=${times[0]}&endTime=${times[1]}`
}); });
} }

21
src/api/screen/subScreen/videoSupervise.ts

@ -0,0 +1,21 @@
import request from "@/api/request";
export function getSubOneAllVideoSuperviseCount(departId,times) {
return request.get({
url: `/datav/sub1/videoSupervise/getSubOneAllVideoSuperviseCount?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}`
});
}
export function getSubOneVideoSuperviseProblemRank(departId,times) {
return request.get({
url: `/datav/sub1/videoSupervise/getSubOneVideoSuperviseProblemRank?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}`
});
}
export function getSubOneVideoSuperviseTrend(departId,year) {
return request.get({
url: `/datav/sub1/videoSupervise/getSubOneVideoSuperviseTrend?departId=${departId}&year=${year}`
});
}

4
src/router/routes.ts

@ -70,6 +70,10 @@ export const routes = [
path: '/datav/sub2', path: '/datav/sub2',
component: () => import('@/views/datav/Sub2.vue'), component: () => import('@/views/datav/Sub2.vue'),
}, },
{
path: '/datav/subOneVideoInsp',
component: () => import('@/views/datav/subonedatav/SubOneVideoInsp.vue'),
},
]; ];

75
src/views/datav/MailVisits.vue

@ -345,7 +345,13 @@ import vCharts from "vue-echarts";
import changshaMap from "@/assets/data/changsha.json"; import changshaMap from "@/assets/data/changsha.json";
import * as echarts from "echarts/core"; import * as echarts from "echarts/core";
import moment from "moment/moment.js"; import moment from "moment/moment.js";
import {getAllMailCount, getEntanglementAndMassMail, getFirstAndRepeatMail, getMailTrend} from "@/api/screen/mail.ts"; import {
getAllMailCount,
getEntanglementAndMassMail,
getFirstAndRepeatMail,
getMailMapIcon,
getMailTrend
} from "@/api/screen/mail.ts";
//region //region
@ -452,9 +458,70 @@ const getEntangleMassRank = async (timeValue = time.value) => {
bwzdEntanglementMailList.value = res.bwzdEntanglementList; bwzdEntanglementMailList.value = res.bwzdEntanglementList;
bwzdMassMailList.value = res.bwzdMassList; bwzdMassMailList.value = res.bwzdMassList;
} }
const mailMapIconList = ref([]);
const getMailMapIconList = async (timeValue = time.value) => {
const res = await getMailMapIcon(timeValue);
const mappedData = res.mailMapIconList.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,
};
});
mailMapIconList.value = mappedData;
console.log(mailMapIconList)
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 getData = () => { const getData = () => {
getFirstAndRepeatMailRank(); getFirstAndRepeatMailRank();
getOverview(); getOverview();
getMailMapIconList()
getTrend(); getTrend();
getEntangleMassRank(); getEntangleMassRank();
} }
@ -520,6 +587,7 @@ const gobalTempMapVoList = [
"numTotal": 44, "numTotal": 44,
} }
]; ];
// const gobalTempMapVoList=[] // const gobalTempMapVoList=[]
const option = ref({ const option = ref({
geo: { geo: {
@ -530,7 +598,7 @@ const option = ref({
trigger: 'item', trigger: 'item',
formatter: function (params) { formatter: function (params) {
console.log(params) console.log(params)
const dataItem = gobalTempMapVoList.find(item => item.name.includes(params.name.substring(0, 2))); const dataItem = mailMapIconList.value.find(item => item.name.includes(params.name.substring(0, 2)));
if (dataItem) { if (dataItem) {
return ` return `
<div class="tooltip"> <div class="tooltip">
@ -540,7 +608,7 @@ const option = ref({
<li>信访总件数 <span>${dataItem.total}</span></li> <li>信访总件数 <span>${dataItem.total}</span></li>
<li>国家信访 <span>${dataItem.countryTotal}</span></li> <li>国家信访 <span>${dataItem.countryTotal}</span></li>
<li>公安部信访 <span>${dataItem.policeTotal}</span></li> <li>公安部信访 <span>${dataItem.policeTotal}</span></li>
<li>局长信箱 <span>${dataItem.policeTotal}</span></li> <li>局长信箱 <span>${dataItem.commissionerTotal}</span></li>
<li>12337信访 <span>${dataItem.numTotal}</span></li> <li>12337信访 <span>${dataItem.numTotal}</span></li>
</ul> </ul>
</div> </div>
@ -560,7 +628,6 @@ const option = ref({
</div>`; </div>`;
} }
}, },
}, },
visualMap: { visualMap: {

3
src/views/datav/SceneInsp.vue

@ -1125,8 +1125,7 @@ const getData = async () => {
jsdwRankOverview.value = res.jsdwRankOverview; jsdwRankOverview.value = res.jsdwRankOverview;
fxsjChangedRankList.value = res.fxsjChangedRankList; fxsjChangedRankList.value = res.fxsjChangedRankList;
jsdwChangedRankList.value = res.jsdwChangedRankList; jsdwChangedRankList.value = res.jsdwChangedRankList;
// rankOverview.value = res.rankOverview; // console.log(fxsjChangedRankList.value);
// data1.value = res.changedRankList;
}); });
getSupervisionTrend(new Date().getFullYear()).then((res) => { getSupervisionTrend(new Date().getFullYear()).then((res) => {

96
src/views/datav/Sub1.vue

@ -16,7 +16,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
22 {{ supervisionPrecinctOverView.one }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
问题数 问题数
@ -26,7 +26,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
22 {{ supervisionPrecinctOverView.two }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
整改中 整改中
@ -36,7 +36,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
22 {{ supervisionPrecinctOverView.three }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
已整改 已整改
@ -46,7 +46,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
22% {{ supervisionPrecinctOverView.four }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
整改率 整改率
@ -54,13 +54,15 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="350px"> <el-scrollbar height="275px">
<datav-chart-bar <datav-chart-bar
:size="small" :size="small"
title="整改率排名" title="整改率排名"
sub-title="已整改/问题数" sub-title="完成数/问题数"
:data="supervisionPrecinctRank"
unit="%" unit="%"
labelWidth="110"
remarkFontSize="14px"
/> />
</el-scrollbar> </el-scrollbar>
</datav-tab-item> </datav-tab-item>
@ -69,7 +71,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
22 {{ supervisionTeamOverView.one }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
问题数 问题数
@ -79,7 +81,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
22 {{ supervisionTeamOverView.two }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
整改中 整改中
@ -89,7 +91,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
22 {{ supervisionTeamOverView.three }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
已整改 已整改
@ -99,7 +101,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
22% {{ supervisionTeamOverView.four }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
整改率 整改率
@ -107,7 +109,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="350px"> <el-scrollbar height="275px">
<datav-chart-bar <datav-chart-bar
:size="small" :size="small"
@ -167,7 +169,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="350px"> <el-scrollbar height="275px">
<datav-chart-bar <datav-chart-bar
:size="small" :size="small"
@ -220,7 +222,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="350px"> <el-scrollbar height="275px">
<datav-chart-bar <datav-chart-bar
:size="small" :size="small"
@ -238,27 +240,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="22" :value="overview.one"
title="问题总数" title="问题总数"
style="width: 20%" style="width: 20%"
/> />
<datav-statistic <datav-statistic
:value="22" :value="overview.two"
title="处理中" title="处理中"
style="width: 20%" style="width: 20%"
/> />
<datav-statistic <datav-statistic
:value="33" :value="overview.three"
title="涉及单位" title="涉及单位"
style="width: 20%" style="width: 20%"
/> />
<datav-statistic <datav-statistic
:value="44" :value="overview.four"
title="涉及人员" title="涉及人员"
style="width: 20%" style="width: 20%"
/> />
<datav-statistic <datav-statistic
:value="22" :value="overview.five"
title="办结率" title="办结率"
style="width: 20%" style="width: 20%"
/> />
@ -352,7 +354,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="350px"> <el-scrollbar height="275px">
<datav-chart-bar <datav-chart-bar
:size="small" :size="small"
@ -405,7 +407,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="350px"> <el-scrollbar height="275px">
<datav-chart-bar <datav-chart-bar
:size="small" :size="small"
@ -455,7 +457,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="350px"> <el-scrollbar height="275px">
<datav-chart-bar <datav-chart-bar
:size="small" :size="small"
:data="caseVerifyPrecinctRank" :data="caseVerifyPrecinctRank"
@ -497,7 +499,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="350px"> <el-scrollbar height="275px">
<datav-chart-bar <datav-chart-bar
:size="small" :size="small"
:data="caseVerifyTeamRank" :data="caseVerifyTeamRank"
@ -519,7 +521,12 @@
import vCharts from "vue-echarts"; import vCharts from "vue-echarts";
import moment from "moment"; import moment from "moment";
import * as echarts from "echarts/core"; import * as echarts from "echarts/core";
import {getCaseVerifyRank, getSubOneStreetMap, getSubOneTrend} from "@/api/screen/sub1.ts"; import {
getSubOneCaseVerifyRank, getSubOneOverView,
getSubOneStreetMap,
getSubOneSupervisionRank,
getSubOneTrend
} from "@/api/screen/sub1.ts";
import changshaMap from "@/assets/data/changsha.json"; import changshaMap from "@/assets/data/changsha.json";
@ -881,10 +888,27 @@ const option1 = ref({
}, },
], ],
}); });
const caseVerifyPrecinctOverView = ref({}) const caseVerifyPrecinctOverView = ref({})
const caseVerifyTeamOverView = ref({}) const caseVerifyTeamOverView = ref({})
const caseVerifyPrecinctRank = ref([]) const caseVerifyPrecinctRank = ref([])
const caseVerifyTeamRank = ref([]) const caseVerifyTeamRank = ref([])
const supervisionPrecinctOverView = ref({})
const supervisionTeamOverView = ref({})
const supervisionPrecinctRank = ref([])
const supervisionTeamRank = ref([])
const overview = ref({
one: 0,
two: 0,
three: 0,
four: 0,
five: 0,
})
const getMapJSON = async (departId) => { const getMapJSON = async (departId) => {
const res = await getSubOneStreetMap(departId); const res = await getSubOneStreetMap(departId);
currentMapData.value = res; currentMapData.value = res;
@ -918,20 +942,36 @@ const getTrendData = async (currentDepartId, currentYear) => {
mailTrend.value.series[0].data = mailValues; mailTrend.value.series[0].data = mailValues;
} }
const getCaseVerifyRankList = async (currentDepartId, times) => { const getSubOneCaseVerifyRankList = async (currentDepartId, times) => {
const res = await getCaseVerifyRank(currentDepartId, times); const res = await getSubOneCaseVerifyRank(currentDepartId, times);
console.log(res) // console.log(res)
caseVerifyPrecinctRank.value = res.caseVerifyPrecinctList; caseVerifyPrecinctRank.value = res.caseVerifyPrecinctList;
caseVerifyTeamRank.value = res.caseVerifyTeamList; caseVerifyTeamRank.value = res.caseVerifyTeamList;
caseVerifyPrecinctOverView.value = res.caseVerifyPrecinctOverView; caseVerifyPrecinctOverView.value = res.caseVerifyPrecinctOverView;
caseVerifyTeamOverView.value = res.caseVerifyTeamOverView; caseVerifyTeamOverView.value = res.caseVerifyTeamOverView;
} }
const getSubOneSupervisionRankList = async (currentDepartId, times) => {
const res = await getSubOneSupervisionRank(currentDepartId, times);
// console.log(res)
supervisionPrecinctRank.value = res.supervisionPrecinctList;
supervisionTeamRank.value = res.supervisionTeamList;
supervisionPrecinctOverView.value = res.supervisionPrecinctOverView;
supervisionTeamOverView.value = res.supervisionTeamOverView;
// console.log(supervisionPrecinctOverView.value)
}
const getSubOneOverViewData = async (currentDepartId, times) => {
const res = await getSubOneOverView(currentDepartId, times);
overview.value = res.subOneOverViewVo;
// console.log(overview.value)
}
onMounted(() => { onMounted(() => {
getMapJSON(currentDepartId); getMapJSON(currentDepartId);
getSubOneSupervisionRankList(currentDepartId, time.value);
getSubOneOverViewData(currentDepartId, time.value);
getTrendData(currentDepartId, currentYear); getTrendData(currentDepartId, currentYear);
getCaseVerifyRankList(currentDepartId, time.value); getSubOneCaseVerifyRankList(currentDepartId, time.value);
}) })
function go() { function go() {

12
src/views/datav/VideoInsp.vue

@ -103,6 +103,7 @@
style="height: 420px" style="height: 420px"
:option="option" :option="option"
autoresize autoresize
@click="handleClick"
/> />
<datav-card title="问题趋势"> <datav-card title="问题趋势">
<v-charts <v-charts
@ -195,6 +196,8 @@ import {
getVideoSuperviseProblemRank, getVideoSuperviseMap, getVideoSuperviseTrend getVideoSuperviseProblemRank, getVideoSuperviseMap, getVideoSuperviseTrend
} from "@/api/screen/videoSupervise.ts"; } from "@/api/screen/videoSupervise.ts";
import moment from "moment/moment.js"; import moment from "moment/moment.js";
const router = useRouter();
const time = ref([ const time = ref([
moment().startOf("year").format("YYYY-MM-DD"), moment().startOf("year").format("YYYY-MM-DD"),
moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD"),
@ -496,6 +499,15 @@ const ProblemTypeRateChart = ref({
}); // }); //
// endregion // endregion
const handleClick = (params) => {
const departId = params.data.departId;
const url = router.resolve({
path: "/datav/subOneVideoInsp",
query: {departId: departId},
}).href;
window.open(url, "_blank");
}
const colors = [ const colors = [
{ {

723
src/views/datav/subonedatav/SubOneVideoInsp.vue

@ -0,0 +1,723 @@
<template>
<el-scrollbar height="100vh">
<div class="wrapper">
<datav-header/>
<main>
<el-row :gutter="16">
<el-col :span="6">
<datav-card title="内部视频">
<div class="row mt-4 mb-20">
<div class="col col-8">
<label>视频总数</label>
<span>107</span>
</div>
<div class="col col-8">
<label>在线数</label>
<span>97</span>
</div>
<div class="col col-8">
<label>在线率</label>
<span>91%</span>
</div>
</div>
<div class="mb-12">
<video
width="100%"
height="250"
controls="controls"
autoplay
>
<source src="/mp4/1.mp4" type="video/ogg"/>
</video>
</div>
<el-row :gutter="12">
<el-col :span="8">
<img src="/imgs/datav/1.png" class="active" alt=""/>
</el-col>
<el-col :span="8">
<img src="/imgs/datav/2.jpg" alt=""/>
</el-col>
<el-col :span="8">
<img src="/imgs/datav/3.jpeg" alt=""/>
</el-col>
</el-row>
</datav-card>
<datav-card title="问题数排名" sub-title="问题数" style="height: 370px;">
<datav-tabs
type="bottom-button"
>
<datav-tab-item label="派出所" name="1">
<el-scrollbar height="280px">
<datav-chart-bar
:data="fxsjRankList"
size="large"
:color="colors"
/>
</el-scrollbar>
</datav-tab-item>
<datav-tab-item label="大队" name="2">
<el-scrollbar height="280px">
<datav-chart-bar
:data="jsdwRankList"
:max="11"
size="large"
/>
</el-scrollbar>
</datav-tab-item>
</datav-tabs>
</datav-card>
</el-col>
<el-col :span="12">
<datav-date-picker v-model="time"/>
<div class="flex gap-42">
<datav-statistic
:value="overview.discoverProblem"
title="发现问题数"
style="width: 20%"
/>
<datav-statistic
:value="overview.changedProblem"
title="整改问题数"
style="width: 20%"
/>
<datav-statistic
:value="overview.relativeOrg"
title="涉及单位数"
style="width: 20%"
/>
<datav-statistic
:value="overview.relativePer"
title="涉及人数"
style="width: 20%"
/>
<datav-statistic
:value="overview.changedRate"
value-unit="%"
title="整改率"
style="width: 20%"
/>
</div>
<v-charts
style="height: 420px"
:option="option"
autoresize
ref="subOneVideoInspMapChart"
/>
<datav-card title="问题趋势">
<v-charts
style="height: 250px"
:option="proTrend"
autoresize
/>
<div class="gobal-dropdown-container">
<el-dropdown class="test" @command="handleCommand">
<span class="el-dropdown-link my-gobal-yearselect">
{{ selectedYear + ' 年'}}
</span>
<template #dropdown>
<el-dropdown-menu style="width: 90px">
<el-dropdown-item v-for="year in years" :key="year" :command="year">{{ year + " " }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</datav-card>
</el-col>
<el-col :span="6">
<datav-card title="实时预警">
<el-scrollbar height="450px">
<div class="message message-error">
<div class="message-title">待处理</div>
<div>
芙蓉-定王台-办案区-问室 湖南省长沙市公安局芙蓉分局定王台派出所 &emsp; 民警单人询的违规问题
</div>
<div class="message-footer flex between">
<span>芙蓉分局定王台派出所</span>
<span>2024-11-18 20:12</span>
</div>
</div>
<div class="message message-info">
<div class="message-title">待处理</div>
<div>
望城-管理中心-办案区-询问室湖南省长沙市望城区公安局法制大队&emsp; 民警单人询的违规问题
</div>
<div class="message-footer flex between">
<span>望城区公安局法制大队</span>
<span>2024-11-18 19:12</span>
</div>
</div>
<div class="message">
<div class="message-title">待处理</div>
<div>
执法办案中心-询问室7湖南省长沙市公安局芙蓉分局蓉园派出所 &emsp;同时讯问多名嫌疑对象
</div>
<div class="message-footer flex between">
<span>芙蓉分局蓉园派出所</span>
<span>2024-11-18 16:12</span>
</div>
</div>
<div class="message">
<div class="message-title">待处理</div>
<div>
开福-直属-执法办案管理-讯询问室湖南省长沙市公安局开福分局法制大队 &emsp;民警单人询的违规问题
</div>
<div class="message-footer flex between">
<span>开福分局法制大队</span>
<span>2024-11-18 15:12</span>
</div>
</div>
</el-scrollbar>
</datav-card>
<datav-card title="问题类型占比">
<v-charts
style="height: 300px"
:option="ProblemTypeRateChart"
autoresize
/>
</datav-card>
</el-col>
</el-row>
</main>
</div>
</el-scrollbar>
</template>
<script setup>
import changshaMap from "@/assets/data/changsha.json";
import vCharts from "vue-echarts";
import * as echarts from "echarts/core";
import {
getAllVideoSuperviseCount,
getVideoSuperviseProblemTypeRate,
getVideoSuperviseProblemRank, getVideoSuperviseMap, getVideoSuperviseTrend
} from "@/api/screen/videoSupervise.ts";
import moment from "moment/moment.js";
import {getSubOneStreetMap} from "@/api/screen/sub1.ts";
import {
getSubOneAllVideoSuperviseCount,
getSubOneVideoSuperviseProblemRank, getSubOneVideoSuperviseTrend
} from "@/api/screen/subScreen/videoSupervise.ts";
const time = ref([
moment().startOf("year").format("YYYY-MM-DD"),
moment().format("YYYY-MM-DD"),
]);
const fxsjRankList = ref([]);
const jsdwRankList = ref([]);
const overview = ref({
discoverProblem: 0,
changedProblem: 0,
relativeOrg: 0,
relativePer: 0,
changedRate: 0,
});
const mapIconList = ref([{
originalName:"浏阳市局",
name: "浏阳市",
discoverProblem: 135,
changedProblem: 135,
relativeOrg: 89,
relativePer: 152,
changedRate: 100
}])
const currentYear = new Date().getFullYear();
const years = ref([currentYear.toString(), (currentYear - 1).toString(), (currentYear - 2).toString()]); //
const selectedYear = ref('2024'); //
const currentMapData = ref({})
const subOneVideoInspMapChart = ref(null); //
const route = useRoute();
const currentDepartId = route.query.departId;
// region
const getMapJSON = async (departId) => {
const res = await getSubOneStreetMap(departId);
currentMapData.value = res;
echarts.registerMap("changsha", res);
subOneVideoInspMapChart.value.chart.setOption(option.value);
}
const getOverview = async (departId, timeValue) => {
const res = await getSubOneAllVideoSuperviseCount(departId, timeValue);
overview.value = res.overview;
}
const getMap = async (timeValue) => {
const res = await getVideoSuperviseMap(timeValue);
// console.log(res.videoSuperviseMapIconVoList)
const mappedData = res.videoSuperviseMapIconVoList.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.discoverProblem,
};
});
const total = mappedData.reduce((sum, item) => sum + Number(item.value), 0);
const avg = total / mappedData.length; //
const range30Percent = avg*0.3 //
mapIconList.value = mappedData
option.value.series[0].data = mapIconList
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 getProblemTypeRate = async (timeValue) => {
const res = await getVideoSuperviseProblemTypeRate(timeValue);
ProblemTypeRateChart.value.series[0].data = res.videoSuperviseProblemTypeRate
}
const getRankList = async (departId, timeValue) => {
const res = await getSubOneVideoSuperviseProblemRank(departId, timeValue);
fxsjRankList.value = res.policeVideoSuperviseProblemRankList
jsdwRankList.value = res.teamVideoSuperviseProblemRankList
}
const getTrend = async(departId, year)=> {
const res = await getSubOneVideoSuperviseTrend(departId, year);
const temp = res.videoSuperviseTrendList;
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 getData = async () => {
getOverview(currentDepartId,time.value);
getRankList(currentDepartId, time.value);
// getMap(time.value)
getTrend(currentDepartId, selectedYear.value)
// getProblemTypeRate(time.value);
getMapJSON(currentDepartId)
}
// endregion
// region
watch(time, () => {
getData()
})
onMounted(() => {
getData()
})
const handleCommand = (year) => {
selectedYear.value = year; //
getTrend(selectedYear.value)
};
// endregion
// region
const proTrend = ref({
xAxis: {
type: "category",
boundaryGap: true,
data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月",],
axisTick: {
// X线
show: false
},
},
yAxis: {
type: "value",
splitLine: {
show: true,
lineStyle: {
color: "#193775",
},
},
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'line',
label: {
backgroundColor: '#6a7985'
}
}
},
series: [
{
type: "line",
smooth: true,
lineStyle: {
color: "#28E6FF",
width: 4,
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(40,230,255,0.47)", //
},
{
offset: 1,
color: "rgba(40,230,255,0)", //
},
]),
},
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
},
],
grid: {
left: '5%', //
right: '2%', //
top: '10%', //
bottom: '20%', //
containLabel: false //
},
});
echarts.registerMap("changsha", changshaMap);
const option = ref({
geo: {
map: "changsha",
},
tooltip: {
trigger: 'item',
formatter: function (params) {
const dataItem = mapIconList.value.find(item => item.name.includes(params.name.substring(0, 2)));
if (dataItem) {
return `
<div class="tooltip">
<div class="tooltip-title">${dataItem.originalName}</div>
<div class="tooltip-content">
<ul class="tooltip-ul" >
<li>发现问题数 <span>${dataItem.discoverProblem}</span></li>
<li>整改问题数 <span>${dataItem.changedProblem}</span></li>
<li>涉及单位数 <span>${dataItem.relativeOrg}</span></li>
<li>涉及人数 <span>${dataItem.relativePer}</span></li>
<li>整改率 <span>${dataItem.changedRate}%</span></li>
</ul>
</div>
</div>`;
} else {
return `<div class="tooltip">
<div class="tooltip-title">${params.name}</div>
<div class="tooltip-content">
<ul class="tooltip-ul"">
<li>发现问题数 <span>-</span></li>
<li>整改问题数 <span>-</span></li>
<li>涉及单位数 <span>-</span></li>
<li>涉及人数 <span>-</span></li>
<li>整改率 <span>-</span></li>
</ul>
</div>
</div>`;
}
},
},
visualMap: {
type: "piecewise",
bottom: 10,
pieces: [
{gte: 0, lte: 200, label: "低于平均问题30%", color: "#4987F6"},
{gte: 200, lte: 400, label: "平均问题上下浮动30%内", color: "#F6A149"},
{gte: 400, label: "高于平均问题30%", color: "#D34343"},],
right: 10,
realtime: false,
orient: "horizontal",
textStyle: {
color: "#fff",
},
calculable: true,
inRange: {
color: ["#4987F6","#F6A149", "#D34343" ],
},
},
series: [
{
name: "长沙",
type: "map",
map: "changsha",
hoverAnimation: true,
label: {
show: true,
color: "white",
},
itemStyle: {
normal: {
areaColor: "#02215E",
borderColor: "#24D2EE",
borderWidth: 1 //
},
},
emphasis: {
areaColor: "#FFD700", //
borderColor: "#FF0000", //
borderWidth: 4 //
},
data: mapIconList,
}
],
})
const ProblemTypeRateChart = ref({
series: [
{
type: "pie",
radius: ["40%", "70%"],
label: {
color: "#fff",
},
data: [],
},
],
tooltip: {
trigger: "item",
},
}); //
// endregion
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,
},
];
</script>
<style lang="scss" scoped>
@import "@/style/datav.scss";
img {
width: 100%;
display: block;
border: 1px solid transparent;
&.active {
border-color: #1cd9ff;
}
}
.message {
padding: 10px;
margin-bottom: 10px;
background: linear-gradient(
180deg,
rgba(145, 145, 145, 0) 0%,
rgba(164, 164, 164, 0.26) 98%
);
border: 1px solid;
border-image: linear-gradient(
180deg,
rgba(255, 255, 255, 0.28),
rgba(255, 255, 255, 0.26)
) 1 1;
&.message-error {
background: linear-gradient(
180deg,
rgba(208, 18, 18, 0) 0%,
rgba(255, 0, 0, 0.26) 100%
);
border: 1px solid;
border-image: linear-gradient(
180deg,
rgba(255, 71, 71, 0.59),
rgba(251, 95, 95, 1)
) 1 1;
.message-title {
color: #ff0017;
}
}
&.message-info {
background: linear-gradient(
180deg,
rgba(18, 104, 208, 0) 0%,
rgba(0, 166, 255, 0.26) 100%
);
border: 1px solid;
border-image: linear-gradient(
180deg,
rgba(71, 209, 255, 0.28),
rgba(8, 177, 255, 1)
) 1 1;
.message-title {
color: #1cd9ff;
}
}
.message-title {
font-size: 23px;
font-weight: 700;
margin-bottom: 10px;
color: #597ae9;
}
.message-footer {
font-size: 14px;
color: #597ae9;
margin-top: 10px;
}
}
:deep() {
//
.tooltip {
position: relative;
width: 169.88px;
height: 178px;
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: 30px;
text-align: right;
margin-right: 15px;
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; /* */
}
}
.gobal-dropdown-container {
position: absolute;
right: 20px;
top: 15px;
}
.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>
Loading…
Cancel
Save