|
|
|
|
@ -365,25 +365,18 @@ import vCharts from "vue-echarts";
|
|
|
|
|
import changshaMap from "@/assets/data/changsha.json"; |
|
|
|
|
import * as echarts from "echarts/core"; |
|
|
|
|
import moment from "moment/moment.js"; |
|
|
|
|
import { |
|
|
|
|
getAllMailCount, |
|
|
|
|
getEntanglementAndMassMail, |
|
|
|
|
getMailMapIcon, |
|
|
|
|
getMailTrend |
|
|
|
|
} from "@/api/screen/mail.ts"; |
|
|
|
|
import {getSubOneStreetMap} from "@/api/screen/subScreen/subOneGlobal.ts"; |
|
|
|
|
import { |
|
|
|
|
getSubOneEntanglementAndMassMail, |
|
|
|
|
getSubOneFirstAndRepeatMail, |
|
|
|
|
getSubOneAllMailCount, getSubOneMailTrend, getSubOneMailMapIcon |
|
|
|
|
getSubOneAllMailCount, |
|
|
|
|
getSubOneMailTrend, |
|
|
|
|
getSubOneMailMapIcon |
|
|
|
|
} from "@/api/screen/subScreen/subOneMailVisits.ts"; |
|
|
|
|
|
|
|
|
|
//region 所有变量 |
|
|
|
|
let timer; |
|
|
|
|
const activeTab = ref("1"); |
|
|
|
|
const bwzdActiveTab = ref("1"); // 部委支队初重信tab |
|
|
|
|
const activeMailTrend = ref("1"); // 信访趋势tab |
|
|
|
|
const activeMailTab = ref("1"); |
|
|
|
|
const bwzdActiveTab = ref("1"); |
|
|
|
|
const activeTabRight = ref("1"); |
|
|
|
|
const overview = ref({ |
|
|
|
|
totalMail: 0, |
|
|
|
|
@ -462,6 +455,7 @@ const leaderViewColors = [
|
|
|
|
|
percentage: 0, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
const mailMapIconList = ref([]); |
|
|
|
|
|
|
|
|
|
const subOneFxsjFirstAndRepeatTab = ref("1"); |
|
|
|
|
const subOneFirstAndRepeat = ref(null) |
|
|
|
|
@ -487,7 +481,7 @@ const getMapJSON = async (departId = currentDepartId) => {
|
|
|
|
|
subOneMailMap.value.chart.setOption(option.value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const getSubOneFirstAndRepeatMailRankData = async (depart = currentDepartId, timeValue = time.value) => { |
|
|
|
|
const getSubOneFirstAndRepeatMailData = async (depart = currentDepartId, timeValue = time.value) => { |
|
|
|
|
const res = await getSubOneFirstAndRepeatMail(depart, timeValue) |
|
|
|
|
fxjsFirstAndRepeatOverview.value = res.fxjsFirstAndRepeatOverview; |
|
|
|
|
bwzdFirstAndRepeatOverview.value = res.bwzdFirstAndRepeatOverview |
|
|
|
|
@ -500,11 +494,33 @@ const getSubOneFirstAndRepeatMailRankData = async (depart = currentDepartId, tim
|
|
|
|
|
bwzdLeaderViewMailList.value = res.bwzdLeaderViewRankList; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
const getOverviewData = async (depart = currentDepartId, timeValue = time.value) => { |
|
|
|
|
const getSubOneAllMailCountData = async (depart = currentDepartId, timeValue = time.value) => { |
|
|
|
|
const res = await getSubOneAllMailCount(depart, timeValue) |
|
|
|
|
overview.value = res.overview; |
|
|
|
|
} |
|
|
|
|
const getTrendData = async (departId = currentDepartId, year = selectedYear.value) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getSubOneMailMapIconData = async (departId = currentDepartId, timeValue = time.value) => { |
|
|
|
|
const res = await getSubOneMailMapIcon(departId, timeValue); |
|
|
|
|
const mappedData = res.mailMapIconList.map(item => { |
|
|
|
|
return { |
|
|
|
|
...item, |
|
|
|
|
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 getSubOneMailTrendData = async (departId = currentDepartId, year = selectedYear.value) => { |
|
|
|
|
const res = await getSubOneMailTrend(departId, year); |
|
|
|
|
const policeList = res.policeList; |
|
|
|
|
const manageList = res.manageList; |
|
|
|
|
@ -540,34 +556,12 @@ const getSubOneEntangleMassRankData = async (depart = currentDepartId, timeValue
|
|
|
|
|
bwzdEntanglementMailList.value = res.bwzdEntanglementList; |
|
|
|
|
bwzdMassMailList.value = res.bwzdMassList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const mailMapIconList = ref([]); |
|
|
|
|
const getMailMapIconListData = async (departId = currentDepartId, timeValue = time.value) => { |
|
|
|
|
const res = await getSubOneMailMapIcon(departId, timeValue); |
|
|
|
|
const mappedData = res.mailMapIconList.map(item => { |
|
|
|
|
return { |
|
|
|
|
...item, |
|
|
|
|
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 = () => { |
|
|
|
|
getMapJSON(); |
|
|
|
|
getSubOneFirstAndRepeatMailRankData(); |
|
|
|
|
getOverviewData(); |
|
|
|
|
getMailMapIconListData(); |
|
|
|
|
getTrendData(); |
|
|
|
|
getSubOneFirstAndRepeatMailData(); |
|
|
|
|
getSubOneAllMailCountData(); |
|
|
|
|
getSubOneMailMapIconData(); |
|
|
|
|
getSubOneMailTrendData(); |
|
|
|
|
getSubOneEntangleMassRankData(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1015,7 +1009,7 @@ subOneFxsjEntanglementIntervalId = setInterval(subOneFxsjEntanglementAnimation,
|
|
|
|
|
// region 事件||计算属性||监听 |
|
|
|
|
const handleCommand = (year) => { |
|
|
|
|
selectedYear.value = year; |
|
|
|
|
getTrendData() |
|
|
|
|
getSubOneMailTrendData() |
|
|
|
|
}; |
|
|
|
|
// 监听信访趋势tab切换 |
|
|
|
|
watch(time, () => { |
|
|
|
|
|