diff --git a/src/api/data/supervisionNotify.ts b/src/api/data/supervisionNotify.ts index c90ad9b..75097ee 100644 --- a/src/api/data/supervisionNotify.ts +++ b/src/api/data/supervisionNotify.ts @@ -1,10 +1,14 @@ import request from "@/api/request"; - -export function getAllSupervisionNotifyCount(times) { +export function getChangedRank(times) { + return request.get({ + url: `/datav/supervisonNotify/getChangedRank?beginTime=${times[0]}&endTime=${times[1]}` + }); +} +export function getSupervisionNotifyCount(times) { return request.get({ - url: `/datav/supervisonNotify?beginTime=${times[0]}&endTime=${times[1]}` + url: `/datav/supervisonNotify/getSupervisionNotifyCount?beginTime=${times[0]}&endTime=${times[1]}` }); } @@ -20,11 +24,7 @@ export function getProblemTypeRate(times) { -export function getChangedRank(times, groupType) { - return request.get({ - url: `/datav/supervisonNotify/rank?beginTime=${times[0]}&endTime=${times[1]}&groupType=${groupType}` - }); -} + /** * 获取问题趋势数据 */ @@ -39,9 +39,9 @@ export function getSupervisionTrend(year) { /** * 获取地图数据 */ -export function getMap(times) { +export function getSupervisionNotifyMap(times) { return request.get({ - url: `/datav/supervisonNotify/getMap?beginTime=${times[0]}&endTime=${times[1]}` + url: `/datav/supervisonNotify/getSupervisionNotifyMap?beginTime=${times[0]}&endTime=${times[1]}` }); } diff --git a/src/api/data/basicScreen.ts b/src/api/screen/gobal.ts similarity index 79% rename from src/api/data/basicScreen.ts rename to src/api/screen/gobal.ts index c1452f0..0ec14b5 100644 --- a/src/api/data/basicScreen.ts +++ b/src/api/screen/gobal.ts @@ -3,7 +3,7 @@ import request from "@/api/request"; /** * 信息大屏api * @author: sh - * @date: 2024-011-7 + * @date: 2024-11-7 */ /* @@ -11,7 +11,7 @@ import request from "@/api/request"; */ export function getAllGlobalCount(times) { return request.get({ - url: `/datav/dataGlobalScreen?beginTime=${times[0]}&endTime=${times[1]}` + url: `/datav/dataGlobalScreen/getAllGlobalCount?beginTime=${times[0]}&endTime=${times[1]}` }); } @@ -19,9 +19,9 @@ export function getAllGlobalCount(times) { /** * 获取问题趋势数据 */ -export function getGlobalRecentlyTrendByMonth(year) { +export function getGlobalTrend(year) { return request.get({ - url: `/datav/dataGlobalScreen/getGlobalRecentlyTrendByMonth?year=${year}` + url: `/datav/dataGlobalScreen/getGlobalTrend?year=${year}` }); } @@ -76,7 +76,7 @@ export function getProblemBusinessRate(times) { export function getGlobalMap(times) { return request.get({ - url: `/datav/dataGlobalScreen/getMap?beginTime=${times[0]}&endTime=${times[1]}` + url: `/datav/dataGlobalScreen/getGlobalMap?beginTime=${times[0]}&endTime=${times[1]}` }); } diff --git a/src/api/screen/subScreen/subOneCaseVerif.ts b/src/api/screen/subScreen/subOneCaseVerif.ts index 0449bd1..48573a3 100644 --- a/src/api/screen/subScreen/subOneCaseVerif.ts +++ b/src/api/screen/subScreen/subOneCaseVerif.ts @@ -19,6 +19,12 @@ export function getSubOneAllCaseVerificationCount(departId, times) { }); } +export function getSubOneCaseVerificationMap(departId, times) { + return request.get({ + url: `/datav/sub1/caseVerif/getSubOneCaseVerificationMap?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` + }); +} + export function getSubOneCaseVerificationTrend(departId, year) { return request.get({ url: `/datav/sub1/caseVerif/getSubOneCaseVerificationTrend?departId=${departId}&year=${year}` diff --git a/src/api/screen/subScreen/subOneGlobal.ts b/src/api/screen/subScreen/subOneGlobal.ts index f7f8fc0..1509d01 100644 --- a/src/api/screen/subScreen/subOneGlobal.ts +++ b/src/api/screen/subScreen/subOneGlobal.ts @@ -26,6 +26,12 @@ export function getSubOneAllCount(departId, times) { }); } +export function getSubOneGlobalMap(departId, times) { + return request.get({ + url: `/datav/sub1/getSubOneGlobalMap?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` + }); +} + export function getSubOneGlobalTrend(departId, year) { return request.get({ url: `/datav/sub1/getSubOneGlobalTrend?departId=${departId}&year=${year}` diff --git a/src/api/screen/subScreen/subOneMailVisits.ts b/src/api/screen/subScreen/subOneMailVisits.ts index 2fc96ea..da9d497 100644 --- a/src/api/screen/subScreen/subOneMailVisits.ts +++ b/src/api/screen/subScreen/subOneMailVisits.ts @@ -10,6 +10,12 @@ export function getSubOneFirstAndRepeatMail(departId, times) { } +export function getSubOneMailMapIcon(departId, times) { + return request.get({ + url: `/datav/sub1/mailVisits/getSubOneMailMapIcon?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` + }); +} + export function getSubOneMailTrend(departId, year) { return request.get({ url: `/datav/sub1/mailVisits/getSubOneMailTrend?departId=${departId}&year=${year}` diff --git a/src/api/screen/subScreen/subOneSupervisionNotify.ts b/src/api/screen/subScreen/subOneSupervisionNotify.ts index 45ba0f5..f72b894 100644 --- a/src/api/screen/subScreen/subOneSupervisionNotify.ts +++ b/src/api/screen/subScreen/subOneSupervisionNotify.ts @@ -26,6 +26,11 @@ export function getAllSubOneSupervisionNotifyCount(departId, times) { }); } +export function getSubOneSupervisionMap(departId, times) { + return request.get({ + url: `/datav/sub1/supervisonNotify/getSubOneSupervisionMap?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` + }); +} export function getSubOneYellowBetDrug(departId, times) { return request.get({ diff --git a/src/api/screen/subScreen/subOneVideoSupervise.ts b/src/api/screen/subScreen/subOneVideoSupervise.ts index 7be3011..5fa87a4 100644 --- a/src/api/screen/subScreen/subOneVideoSupervise.ts +++ b/src/api/screen/subScreen/subOneVideoSupervise.ts @@ -1,16 +1,25 @@ import request from "@/api/request"; + + + +export function getSubOneVideoSuperviseProblemRank(departId,times) { + return request.get({ + url: `/datav/sub1/videoSupervise/getSubOneVideoSuperviseProblemRank?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` + }); +} + + 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) { +export function getSubOneVideoSuperviseMap(departId,times) { return request.get({ - url: `/datav/sub1/videoSupervise/getSubOneVideoSuperviseProblemRank?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` + url: `/datav/sub1/videoSupervise/getSubOneVideoSuperviseMap?departId=${departId}&beginTime=${times[0]}&endTime=${times[1]}` }); } diff --git a/src/components/datav/chart-bar.vue b/src/components/datav/chart-bar.vue index 7c46848..d2168bd 100644 --- a/src/components/datav/chart-bar.vue +++ b/src/components/datav/chart-bar.vue @@ -78,7 +78,8 @@ const props = defineProps({ showValue:{ type:Boolean, default:true - } + }, + }); const max = ref(100); @@ -202,5 +203,10 @@ function getColor(val) { text-align: right; width: 60px; } +.dynamic-width { + width: 70%; +} + + diff --git a/src/views/datav/Gobal.vue b/src/views/datav/Gobal.vue index a489ee6..dbbf216 100644 --- a/src/views/datav/Gobal.vue +++ b/src/views/datav/Gobal.vue @@ -140,19 +140,18 @@ import * as echarts from "echarts/core"; import moment from "moment/moment"; import { getBusinessRate, - getGlobalRecentlyTrendByMonth, getOrganizationRank, getProblemBusinessRate, getStrongProblemRate, getGlobalMap, - getAllGlobalCount -} from "@/api/data/basicScreen.ts"; + getAllGlobalCount, + getGlobalTrend +} from "@/api/screen/gobal.ts"; // region 各种变量 const router = useRouter(); - const activeOrgTab = ref("1"); -const fxsjlist = ref([]); // 分县市区机构问题排名 +const fxsjlist = ref([{}]); // 分县市区机构问题排名 const jsdwlist = ref([]); // 局属单位机构问题排名 const ywzblist = ref([]); // 业务类型占比 const wtlxlist = ref([]); // 问题类型占比 @@ -185,13 +184,22 @@ const globalTempMapVoList = ref([ const currentYear = new Date().getFullYear(); const years = ref([currentYear.toString(), (currentYear - 1).toString(), (currentYear - 2).toString()]); // 年份列表 const selectedYear = ref('2024'); // 当前选中的年份 +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, + }, +]; // endregion -function go() { - router.push("/datav/sub1") -} - - // region 图表变量 // 业务类型占比 const zfbaPieOption = computed(() => { @@ -415,26 +423,9 @@ const getAllGlobalCountData = async (timeValue = time.value) => { const res = await getAllGlobalCount(timeValue); overview.value = res.overview; } -const getGlobalRecentlyTrendByMonthData = async (year = selectedYear.value) => { - const res = await getGlobalRecentlyTrendByMonth(year); - const globalRecentlyTrendList = res.globalRecentlyTrendList; - const categories = globalRecentlyTrendList.map(item => item.name); - const values = globalRecentlyTrendList.map(item => item.value); - // 更新图表数据 - proTrend.value.xAxis.data = categories; - proTrend.value.series[0].data = values; -} -const getStrongProblemRateData = async (timeValue = time.value) => { - const res = await getStrongProblemRate(timeValue); - tcwtlist.value = res.tcwtlist; -} -const getProblemBusinessRateData=async (timeValue=time.value)=>{ - const res =await getProblemBusinessRate(timeValue); - wtlxlist.value = res.wtlxlist; -} -const getGlobalMapData= async(timeValue=time.value)=>{ - const res =await getGlobalMap(timeValue); +const getGlobalMapData = async (timeValue = time.value) => { + const res = await getGlobalMap(timeValue); const mappedData = res.globalTempMapVoList.map(item => { let name; switch (item.name) { @@ -490,17 +481,34 @@ const getGlobalMapData= async(timeValue=time.value)=>{ {gte: avg + range30Percent, label: "高于平均问题30%", color: "#D34343"}, ]; } -// endregion -// region 初始化数据 +const getGlobalTrendData = async (year = selectedYear.value) => { + const res = await getGlobalTrend(year); + const globalRecentlyTrendList = res.globalRecentlyTrendList; + const categories = globalRecentlyTrendList.map(item => item.name); + const values = globalRecentlyTrendList.map(item => item.value); + // 更新图表数据 + proTrend.value.xAxis.data = categories; + proTrend.value.series[0].data = values; +} +const getStrongProblemRateData = async (timeValue = time.value) => { + const res = await getStrongProblemRate(timeValue); + tcwtlist.value = res.tcwtlist; +} + +const getProblemBusinessRateData = async (timeValue = time.value) => { + const res = await getProblemBusinessRate(timeValue); + wtlxlist.value = res.wtlxlist; +} + function getData() { getOrganizationRankData(); getBusinessRateData(); getAllGlobalCountData(); - getGlobalRecentlyTrendByMonthData(); + getGlobalMapData(); + getGlobalTrendData(); getStrongProblemRateData(); getProblemBusinessRateData(); - getGlobalMapData(); } onMounted(() => { @@ -523,7 +531,6 @@ const handleCommand = (year) => { watch(time, () => { getData(); }); - const handleClick = (params) => { const departId = params.data.departId; const url = router.resolve({ @@ -532,24 +539,9 @@ const handleClick = (params) => { }).href; window.open(url, "_blank"); } - // 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, - }, -]; diff --git a/src/views/datav/MailVisits.vue b/src/views/datav/MailVisits.vue index c5eeb7a..b4128e6 100644 --- a/src/views/datav/MailVisits.vue +++ b/src/views/datav/MailVisits.vue @@ -617,7 +617,7 @@ const option = ref({ if (dataItem) { return `
-
${dataItem.name}
+
${dataItem.originalName}
`; } }, - // backgroundColor: "#031577", // - // borderColor: "#0A2F86", borderWidth: 0, // 设置边框宽度为1像素 borderRadius: 3, // 设置边框半径为3像素 shadowBlur: 0, // 设置阴影模糊程度为8像素 @@ -400,29 +401,45 @@ const proTrend = ref({ // endregion // region 所有函数 - -const getMapJSON = async (departId) => { +const getMapJSON = async (departId = currentDepartId) => { const res = await getSubOneStreetMap(departId); currentMapData.value = res; echarts.registerMap("changsha", res); chart.value.chart.setOption(option.value); } -const getOrganizationProRankData = async (departId, timeValue = time.value) => { +const getOrganizationProRankData = async (departId = currentDepartId, timeValue = time.value) => { const res = await getSubOneOrganizationRank(departId, timeValue); fxsjlist.value = res.fxsjlist; jsdwlist.value = res.jsdwlist; } - -const getBusinessRateData = async (departId, timeValue = time.value) => { +const getBusinessRateData = async (departId = currentDepartId, timeValue = time.value) => { const res = await getSubOneBusinessRate(departId, timeValue); ywzblist.value = res.ywzblist; } -const getAllGlobalCountData = async (departId, timeValue = time.value) => { +const getAllGlobalCountData = async (departId = currentDepartId, timeValue = time.value) => { const res = await getSubOneAllCount(departId, timeValue); overview.value = res.overview; } - -const getSubOneGlobalTrendData =async (departId, year)=>{ +const getSubOneGlobalMapIcon = async (departId = currentDepartId, timeValue = time.value) => { + const res = await getSubOneGlobalMap(departId, timeValue) + const mappedData = res.globalTempMapVoList.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 // 不用取整,小数也可以 + globalTempMapVoList.value = mappedData; + option.value.series[0].data = globalTempMapVoList; + 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 getSubOneGlobalTrendData = async (departId = currentDepartId, year) => { const res = await getSubOneGlobalTrend(departId, year); const categories = res.globalRecentlyTrendList.map(item => item.name); const values = res.globalRecentlyTrendList.map(item => item.value); @@ -430,74 +447,44 @@ const getSubOneGlobalTrendData =async (departId, year)=>{ proTrend.value.xAxis.data = categories; proTrend.value.series[0].data = values; } -const getSubOneStrongProblemRateData = async (departId, timeValue = time.value) => { +const getSubOneStrongProblemRateData = async (departId = currentDepartId, timeValue = time.value) => { const res = await getSubOneStrongProblemRate(departId, timeValue); tcwtlist.value = res.tcwtlist; } - -const getSubOneProblemBusinessRateData = async (departId, timeValue = time.value) => { - const res = await getSubOneProblemBusinessRate(departId,timeValue); +const getSubOneProblemBusinessRateData = async (departId = currentDepartId, timeValue = time.value) => { + const res = await getSubOneProblemBusinessRate(departId, timeValue); wtlxlist.value = res.wtlxlist; } -// endregion - -// region 初始化数据 - -onMounted(() => { +const getData = () => { getOrganizationProRankData(currentDepartId, time.value); getBusinessRateData(currentDepartId, time.value); getAllGlobalCountData(currentDepartId, time.value); + getSubOneGlobalMapIcon(currentDepartId, time.value); getSubOneGlobalTrendData(currentDepartId, selectedYear.value); getSubOneStrongProblemRateData(currentDepartId, time.value); getSubOneProblemBusinessRateData(currentDepartId, time.value); getMapJSON(currentDepartId); + +}; + +onMounted(() => { + getData() }); // endregion -// region 事件||监听 +// region 事件||监听 const handleCommand = (year) => { selectedYear.value = year; // 更新当前选中的年份 - getGlobalRecentlyTrendByMonth(year).then(res => { - const globalRecentlyTrendList = res.globalRecentlyTrendList; - const categories = globalRecentlyTrendList.map(item => item.name); - const values = globalRecentlyTrendList.map(item => item.value); - // 更新图表数据 - proTrend.value.xAxis.data = categories; - proTrend.value.series[0].data = values; - }); + getSubOneGlobalTrendData(currentDepartId, selectedYear.value); }; watch(time, () => { getData(); }); - -const handleClick = (params) => { - const departId = params.data.departId; - const url = router.resolve({ - path: "/datav/sub1", - query: {departId: departId}, - }).href; - window.open(url, "_blank"); -} - // 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, - }, -]; diff --git a/src/views/datav/subonedatav/SubOneMailVisits.vue b/src/views/datav/subonedatav/SubOneMailVisits.vue index 848d6cb..fc8e040 100644 --- a/src/views/datav/subonedatav/SubOneMailVisits.vue +++ b/src/views/datav/subonedatav/SubOneMailVisits.vue @@ -52,6 +52,7 @@ size="large" :max="11" :color="colors" + label-width="110" /> @@ -62,6 +63,7 @@ :max="11" size="large" :color="colors" + label-width="110" /> @@ -71,6 +73,7 @@ :data="fxsjLeaderViewMailList" :max="11" size="large" + label-width="110" /> @@ -86,6 +89,7 @@ @@ -95,6 +99,7 @@ :data="bwzdRepeatMailList" :max="11" size="large" + label-width="110" /> @@ -104,6 +109,7 @@ :data="bwzdLeaderViewMailList" :max="11" size="large" + label-width="110" /> @@ -257,6 +263,7 @@ size="large" :max="11" :color="colors" + label-width="110" /> @@ -267,6 +274,7 @@ :max="11" size="large" :color="colors" + label-width="110" /> @@ -277,6 +285,7 @@ :max="11" size="large" :color="colors" + label-width="110" /> @@ -291,6 +300,7 @@ @@ -300,6 +310,7 @@ :data="bwzdEntanglementMailList" :max="11" size="large" + label-width="110" /> @@ -310,6 +321,7 @@ :max="11" size="large" :color="colors" + label-width="110" /> @@ -354,7 +366,7 @@ import {getSubOneStreetMap} from "@/api/screen/subScreen/subOneGlobal.ts"; import { getSubOneEntanglementAndMassMail, getSubOneFirstAndRepeatMail, - getSubOneAllMailCount, getSubOneMailTrend + getSubOneAllMailCount, getSubOneMailTrend, getSubOneMailMapIcon } from "@/api/screen/subScreen/subOneMailVisits.ts"; @@ -415,6 +427,21 @@ const route = useRoute(); const currentMapData = ref({}) const chart = ref(null); // 地图 const currentDepartId = route.query.departId; +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, + }, +]; + //endregion // region 所有函数 @@ -480,49 +507,11 @@ const getSubOneEntangleMassRankData = async (depart = currentDepartId, timeValue } const mailMapIconList = ref([]); -const getMailMapIconList = async (timeValue = time.value) => { - const res = await getMailMapIcon(timeValue); +const getMailMapIconListData = async (departId = currentDepartId, timeValue = time.value) => { + const res = await getSubOneMailMapIcon(departId, 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, }; }); @@ -542,21 +531,12 @@ const getData = () => { getMapJSON(); getSubOneFirstAndRepeatMailRankData(); getOverviewData(); + getMailMapIconListData(); getTrendData(); getSubOneEntangleMassRankData(); - // getOverview(); - // getMailMapIconList() - // getTrend(); - // getEntangleMassRank(); } -const currentOverview = computed(() => { - return activeTab.value === '1' ? fxjsFirstAndRepeatOverview.value : bwzdFirstAndRepeatOverview.value; -}); -const currentRightOverview = computed(() => { - return activeTabRight.value === '1' ? fxsjMailEntanglementMassOverview.value : bwzdMailEntanglementMassOverview.value; -}); // endregion @@ -619,22 +599,18 @@ const gobalTempMapVoList = [ "numTotal": 44, } ]; - // const gobalTempMapVoList=[] const option = ref({ - geo: { - map: "changsha", - - }, tooltip: { trigger: 'item', formatter: function (params) { - console.log(params) - const dataItem = mailMapIconList.value.find(item => item.name.includes(params.name.substring(0, 2))); - if (dataItem) { + const dataItem = mailMapIconList.value.find(item => item.name === params.name) || {}; // 找到对应的数据项 + // console.log("Data item:", dataItem); + console.log("Data item:", mailMapIconList.value); + if (dataItem.name===params.name ) { return `
-
${dataItem.name}
+
${params.name}
  • 信访总件数 ${dataItem.total}
  • @@ -687,6 +663,7 @@ const option = ref({ type: "map", map: "changsha", hoverAnimation: true, + roam: true, label: { show: true, color: "white", @@ -1006,6 +983,7 @@ const option3 = { // endregion +// region 事件||计算属性||监听 const handleCommand = (year) => { selectedYear.value = year; getTrendData() @@ -1021,21 +999,13 @@ onMounted(() => { // console.log("Active Tab: ", activeMailTab.value); // }, 3000); // 每3秒切换一次 }); - -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 currentOverview = computed(() => { + return activeTab.value === '1' ? fxjsFirstAndRepeatOverview.value : bwzdFirstAndRepeatOverview.value; +}); +const currentRightOverview = computed(() => { + return activeTabRight.value === '1' ? fxsjMailEntanglementMassOverview.value : bwzdMailEntanglementMassOverview.value; +}); +// endregion diff --git a/src/views/datav/subonedatav/SubOneSceneInsp.vue b/src/views/datav/subonedatav/SubOneSceneInsp.vue index d5ac188..57fdf1b 100644 --- a/src/views/datav/subonedatav/SubOneSceneInsp.vue +++ b/src/views/datav/subonedatav/SubOneSceneInsp.vue @@ -796,7 +796,7 @@ import {getSubOneStreetMap} from "@/api/screen/subScreen/subOneGlobal.ts"; import { getAllSubOneSupervisionNotifyCount, getSubOneChangedRank, getSubOneCheckBeer, getSubOneCompanyProblem, getSubOneGunController, getSubOneHandleCase, - getSubOneProblemTypeRate, + getSubOneProblemTypeRate, getSubOneSupervisionMap, getSubOneSupervisionTrend, getSubOneYellowBetDrug } from "@/api/screen/subScreen/subOneSupervisionNotify.ts"; @@ -921,45 +921,43 @@ const messages = ref([ const currentYear = new Date().getFullYear(); const years = ref([currentYear.toString(), (currentYear - 1).toString(), (currentYear - 2).toString()]); // 年份列表 const selectedYear = ref('2024'); // 当前选中的年份 -const avg = 1000 const subOneSceneInspMapChart = ref(null); // 地图 const route = useRoute(); const currentDepartId = route.query.departId; +const time = ref([ + moment().startOf("year").format("YYYY-MM-DD"), + moment().format("YYYY-MM-DD"), +]); +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, + }, +]; // endregion // region 所有图表 -const wtlxPieOption = computed(() => { - return { - tooltip: { - trigger: "item", - }, - series: [ - { - type: "pie", - radius: ["40%", "70%"], - label: { - color: "#fff", - }, - data: wtlxList.value, - }, - ], - }; -}); echarts.registerMap("changsha", changshaMap); -const superviseTempMapVoList = ref([]); const option = ref({ - tooltip: { trigger: 'item', formatter: function (params) { - console.log(params) - const dataItem = superviseTempMapVoList.value.find(item => item.name.includes(params.name.substring(0, 2))); - if (dataItem) { + const dataItem = superviseTempMapVoList.value.find(item => item.name === params.name) || {}; // 找到对应的数据项 + console.log("Data item:", dataItem); + if (dataItem.name===params.name ) { return `
    -
    ${dataItem.originalName}
    +
    ${params.name}
    • 通报问题数 ${dataItem.totalPro}
    • @@ -1002,18 +1000,15 @@ const option = ref({ color: "#fff", }, calculable: true, - // inRange: { - // color: ['#4987F6', '#F6A149', '#D34343'] - // } - }, + }, series: [ { name: "长沙", type: "map", map: "changsha", hoverAnimation: true, - roam:true, + roam: true, label: { show: true, color: "white", @@ -1034,6 +1029,24 @@ const option = ref({ } ], }) +const wtlxPieOption = computed(() => { + return { + tooltip: { + trigger: "item", + }, + series: [ + { + type: "pie", + radius: ["40%", "70%"], + label: { + color: "#fff", + }, + data: wtlxList.value, + }, + ], + }; +}); +const superviseTempMapVoList = ref([]); const proTrend = ref({ grid: { left: '5%', // 图表距离容器左边的距离 @@ -1099,28 +1112,15 @@ const proTrend = ref({ // endregion -const handleCommand = (year) => { - selectedYear.value = year; // 更新当前选中的年份 - getSupervisionTrend(currentDepartId, year).then(res => { - const supervisionTrend = res.supervisionTrend; - const categories = supervisionTrend.map(item => item.name); - const values = supervisionTrend.map(item => item.value); - // 更新图表数据 - proTrend.value.xAxis.data = categories; - proTrend.value.series[0].data = values; - }); -}; - - // region 所有函数 -const getMapJSON = async (currentDepartId) => { - const res = await getSubOneStreetMap(currentDepartId) +const getMapJSON = async (departId = currentDepartId) => { + const res = await getSubOneStreetMap(departId) echarts.registerMap("changsha", res); subOneSceneInspMapChart.value.chart.setOption(option.value); } -const getChangedRank = async(currentDepartId, times)=>{ - const res = await getSubOneChangedRank(currentDepartId, times) +const getChangedRank = async (departId, times) => { + const res = await getSubOneChangedRank(departId, times) fxsjRankOverview.value = res.fxsjRankOverview; jsdwRankOverview.value = res.jsdwRankOverview; fxsjChangedRankList.value = res.fxsjChangedRankList; @@ -1129,14 +1129,14 @@ const getChangedRank = async(currentDepartId, times)=>{ } -const getProblemTypeRate = async(currentDepartId, times)=>{ - const res = await getSubOneProblemTypeRate(currentDepartId, times) +const getProblemTypeRate = async (departId, times) => { + const res = await getSubOneProblemTypeRate(departId, times) wtlxList.value = res.wtlxList console.log(res); } -const getSupervisionOverView = async(currentDepartId, times)=>{ - const res = await getAllSubOneSupervisionNotifyCount(currentDepartId, times) +const getSupervisionOverView = async (departId, times) => { + const res = await getAllSubOneSupervisionNotifyCount(departId, times) Object.assign(overview.value, { correctionRate: Number(res.overview.rectifyRate), supervisionNotifyPreTotal: Number(res.overview.personNumber), @@ -1147,8 +1147,27 @@ const getSupervisionOverView = async(currentDepartId, times)=>{ }); } -const getSupervisionTrend = async(currentDepartId, times)=>{ - const res = await getSubOneSupervisionTrend(currentDepartId, times) +const getMapData = async (departId, times) => { + const res = await getSubOneSupervisionMap(departId, times); + const mappedData = res.superviseTempMapVoList.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 // 不用取整,小数也可以 + 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"}, + ]; + superviseTempMapVoList.value = mappedData; + option.value.series[0].data = mappedData; +} +const getSupervisionTrend = async (departId, times) => { + const res = await getSubOneSupervisionTrend(departId, times) const supervisionTrend = res.supervisionTrend; const categories = supervisionTrend.map(item => item.name); const values = supervisionTrend.map(item => item.value); @@ -1156,53 +1175,45 @@ const getSupervisionTrend = async(currentDepartId, times)=>{ proTrend.value.series[0].data = values; } -const getYellowBetDrugData = async(currentDepartId, times)=>{ - const res = await getSubOneYellowBetDrug(currentDepartId, times) +const getYellowBetDrugData = async (departId, times) => { + const res = await getSubOneYellowBetDrug(departId, times) fxsjYellowBetOverview.value = res.fxsjYellowBetOverview jsdwYellowBetOverview.value = res.jsdwYellowBetOverview fxsjYellowBetRankList.value = res.fxsjYellowBetRankList jsdwYellowBetRankList.value = res.jsdwYellowBetRankList } -const getGunControllerData = async(currentDepartId, times)=>{ - const res = await getSubOneGunController(currentDepartId, times) +const getGunControllerData = async (departId, times) => { + const res = await getSubOneGunController(departId, times) fxsjGunControllerOverview.value = res.fxsjGunControllerOverview jsdwGunControllerOverview.value = res.jsdwGunControllerOverview fxsjGunControllerRankList.value = res.fxsjGunControllerRankList jsdwGunControllerRankList.value = res.jsdwGunControllerRankList } -const getCompanyProblemData = async(currentDepartId, times)=>{ - const res = await getSubOneCompanyProblem(currentDepartId, times) +const getCompanyProblemData = async (departId, times) => { + const res = await getSubOneCompanyProblem(departId, times) fxsjCompanyProblemOverview.value = res.fxsjCompanyProblemOverview jsdwCompanyProblemOverview.value = res.jsdwCompanyProblemOverview fxsjCompanyProblemRankList.value = res.fxsjCompanyProblemRankList jsdwCompanyProblemRankList.value = res.jsdwCompanyProblemRankList } -const getHandleCaseData = async(currentDepartId, times)=>{ - const res = await getSubOneHandleCase(currentDepartId, times) +const getHandleCaseData = async (departId, times) => { + const res = await getSubOneHandleCase(departId, times) fxsjHandleCaseOverview.value = res.fxsjHandleCaseOverview jsdwHandleCaseOverview.value = res.jsdwHandleCaseOverview fxsjHandleCaseRankList.value = res.fxsjHandleCaseRankList jsdwHandleCaseRankList.value = res.jsdwHandleCaseRankList } -const getCheckBeerData = async(currentDepartId, times)=>{ - const res = await getSubOneCheckBeer(currentDepartId, times) +const getCheckBeerData = async (departId, times) => { + const res = await getSubOneCheckBeer(departId, times) fxsjCheckBeerOverview.value = res.fxsjCheckBeerOverview jsdwCheckBeerOverview.value = res.jsdwCheckBeerOverview fxsjCheckBeerRankList.value = res.fxsjCheckBeerRankList jsdwCheckBeerRankList.value = res.jsdwCheckBeerRankList } -// endregion - - -// region 初始化数据 -const time = ref([ - moment().startOf("year").format("YYYY-MM-DD"), - moment().format("YYYY-MM-DD"), -]); const getData = async () => { @@ -1210,6 +1221,7 @@ const getData = async () => { getChangedRank(currentDepartId, time.value); getProblemTypeRate(currentDepartId, time.value); getSupervisionOverView(currentDepartId, time.value); + getMapData(currentDepartId, time.value); getSupervisionTrend(currentDepartId, time.value); getYellowBetDrugData(currentDepartId, time.value); getGunControllerData(currentDepartId, time.value); @@ -1217,6 +1229,9 @@ const getData = async () => { getHandleCaseData(currentDepartId, time.value); getCheckBeerData(currentDepartId, time.value); } +// endregion + +// region 监听 watch(time, () => { getData(); @@ -1226,21 +1241,18 @@ watch(time, () => { onMounted(() => { getData(); }); +const handleCommand = (year) => { + selectedYear.value = year; // 更新当前选中的年份 + getSupervisionTrend(currentDepartId, year).then(res => { + const supervisionTrend = res.supervisionTrend; + const categories = supervisionTrend.map(item => item.name); + const values = supervisionTrend.map(item => item.value); + // 更新图表数据 + proTrend.value.xAxis.data = categories; + proTrend.value.series[0].data = values; + }); +}; -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, - }, -]; // endregion diff --git a/src/views/datav/subonedatav/SubOneVideoInsp.vue b/src/views/datav/subonedatav/SubOneVideoInsp.vue index d070546..eb4a9ec 100644 --- a/src/views/datav/subonedatav/SubOneVideoInsp.vue +++ b/src/views/datav/subonedatav/SubOneVideoInsp.vue @@ -115,7 +115,7 @@
      - {{ selectedYear + ' 年'}} + {{ selectedYear + ' 年' }}