diff --git a/src/api/data/aduit.ts b/src/api/data/aduit.ts index c7c1e40..4289c3a 100644 --- a/src/api/data/aduit.ts +++ b/src/api/data/aduit.ts @@ -14,6 +14,19 @@ export function getAuditNegativeVo(times){ } +/** + * 获取一级审计督察地图数据 + * @param times + */ +export function getOverview(body){ + return request.post({ + url: `/datav/audit/getOverview`, + body + }) +} + + + /** * 获取一级审计督察地图数据 * @param times @@ -23,4 +36,25 @@ export function getAuditMap(body){ url: `/datav/audit/getAuditMap`, body }) +} + +/** + * 获取审计项目类型 + * @param body + */ +export function getAuditType(body) { + return request.post({ + url: `/datav/audit/getAuditType`, + body + }); +} + + +/** + * 审计工作趋势 + */ +export function getAuditTrend(year) { + return request.get({ + url: `/datav/audit/getAuditTrend?year=${year}` + }); } \ No newline at end of file diff --git a/src/views/datav/AuditSuper.vue b/src/views/datav/AuditSuper.vue index 543b86b..f4e6c9a 100644 --- a/src/views/datav/AuditSuper.vue +++ b/src/views/datav/AuditSuper.vue @@ -65,8 +65,8 @@ style="width: 20%" /> @@ -91,7 +91,32 @@ style="height: 300px" :option="option1" autoresize + ref="auditTrend" /> +
+ + + {{ selectedYear + " 年" }} + + + +
@@ -133,7 +158,13 @@ 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 {getWorkDynamics, getAuditNegativeVo, getAuditMap} from "@/api/data/aduit.ts"; +import { + getWorkDynamics, + getAuditNegativeVo, + getAuditMap, + getAuditType, + getAuditTrend, getOverview +} from "@/api/data/aduit.ts"; import { workDynamicColorMapping } from "@/enums/workDynamicColorMapping.js"; import { getAuditOverview, getAuditProblems } from '@/api/datav' import { onMounted } from "vue"; @@ -154,6 +185,7 @@ const overview = ref({ projectNumber: 0, auditAmount: 0, auditSjAmount: 0, + auditWtAmount: 0, }); const problemOptions = ref({ @@ -177,13 +209,7 @@ onMounted(() => { }) function getData() { - getAuditOverview(time.value).then(data => { - debugger - overview.value = data; - // overview.value.projectNumber = 496; - // overview.value.auditAmount = 12169.83 - // overview.value.auditSjAmount =1096.89 - }); + getOverviewFun(); getAuditProblems(time.value).then(data => { console.log(data) problemOptions.value.series[0].data = data @@ -191,6 +217,8 @@ function getData() { getWorkDynamicsData(); getAuditNegativeVoFun(); getAuditMapData(); + getAuditTypeFun(); + getAuditTrendFun(); } @@ -202,75 +230,69 @@ const getAuditNegativeVoFun =async ()=>{ if(res){ fxData.value=res.fxData; jsData.value=res.jsData; + } +} + +/** + * 项目类型 + * @returns {Promise} + */ +const getAuditTypeFun = async ()=>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1] + } + const res = await getAuditType(body); + if(res){ option2.value.series[0].data = res.barData; } } + +/** + * 总览数据 + * @returns {Promise} + */ +const getOverviewFun = async()=>{ + const body = { + beginTime: time.value[0], + endTime: time.value[1] + } + overview.value = await getOverview(body); +} + + + +const auditTrend = ref(null); +const currentYear = new Date().getFullYear(); +const years = ref([ + currentYear.toString(), + (currentYear - 1).toString(), + (currentYear - 2).toString(), +]); // 年份列表 +const selectedYear = ref(currentYear); // 当前选中的年份 +// 更换年份事件 +const handleCommand = (year) => { + selectedYear.value = year; // 更新当前选中的年份 + // 这里可以添加获取对应年份数据的逻辑 + getAuditTrendFun(); +}; + +/** + * 审计工作趋势 + * @type {Ref, UnwrapRef | string>} + */ +const getAuditTrendFun = async (year = selectedYear.value) => { + const res = await getAuditTrend(year); + // // 更新图表数据 + option1.value.xAxis.data = res.auditTrend.map((item) => item.name); + option1.value.series[0].data = res.auditTrend.map((item) => item.value); +} + + + + const auditSuperRankTab = ref('1'); -// let auditMapData = [ -// { -// name: "天心分局", -// reviewOrg: 0, -// checkPro: 0, -// rushPro: 0, -// changed: 0, -// }, -// { -// name: "开福分局", -// reviewOrg: 0, -// checkPro: 186, -// rushPro: 0, -// changed: 137, -// }, -// { -// name: "湘江新区", -// reviewOrg: 0, -// checkPro: 11, -// rushPro: 0, -// changed: 0, -// }, -// { -// name: "望城分局", -// reviewOrg: 0, -// checkPro: 0, -// rushPro: 0, -// changed: 0, -// }, -// { -// name: "浏阳市局", -// reviewOrg: 0, -// checkPro: 0, -// rushPro: 0, -// changed: 0, -// }, -// { -// name: "长沙县局", -// reviewOrg: 0, -// checkPro: 0, -// rushPro: 0, -// changed: 0, -// }, -// { -// name: "芙蓉分局", -// reviewOrg: 0, -// checkPro: 1, -// rushPro: 0, -// changed: 1, -// }, -// { -// name: "雨花分局", -// reviewOrg: 0, -// checkPro: 240, -// rushPro: 0, -// changed: 220, -// }, -// { -// name: "宁乡市局", -// reviewOrg: 0, -// checkPro: 232, -// rushPro: 194, -// changed: 194, -// }, -// ]; + const auditMapData = ref([ { originalName: "浏阳市局", @@ -710,6 +732,26 @@ const getAuditMapData = async ()=>{ } } + +.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; +}