From 4ab7a04c92a48e0934bd4d6c2a773320308584b7 Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Sun, 13 Oct 2024 17:44:53 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E9=A6=96=E9=A1=B5=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=9B=9B=E4=B8=AA=E7=8A=B6=E6=80=81=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/index.js | 8 ++++++ src/views/home/index.vue | 60 +++++++++++++++------------------------- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/src/api/home/index.js b/src/api/home/index.js index caed0b7..68598fe 100644 --- a/src/api/home/index.js +++ b/src/api/home/index.js @@ -21,3 +21,11 @@ export const getSpecialFundChart = () => { method: "get" }); }; + +//获取首页四个统计数量 +export const getHomeStatistics = () => { + return request({ + url: '/workflow/mosr/process/task/statistics', + method: "get" + }); +}; diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 23b7cbb..50c8dcd 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -43,13 +43,6 @@
- - - - - - -
@@ -73,13 +66,6 @@
- - - - - - -
@@ -101,10 +87,6 @@
- - - -
@@ -128,12 +110,6 @@
- - - - - -
@@ -317,14 +293,12 @@ import {useAuthStore} from '@/stores/userstore.js' import * as echarts from 'echarts' import {toThousands} from "@/utils/changePrice.js"; import {ElNotification} from "element-plus"; -import {getHomeTaskInfo, getDoneTaskInfo} from "@/api/home"; +import {getHomeTaskInfo, getDoneTaskInfo,getHomeStatistics, getSpecialFundChart} from "@/api/home"; import {getResearchFundChart} from "@/api/research-fund"; import {getArticle} from "@/api/article"; -import {getSpecialFundChart} from "../../api/home"; const AuthStore = useAuthStore() const router = useRouter() -const topLeftHeight = ref('') const researchFundYear = ref(new Date().getFullYear() + '') const activeName = ref('first') const docActiveTab = ref('first') @@ -349,7 +323,7 @@ const taskTabList = ref([ color: '#CEE8FA', textColor: '#0043C5', icon: 'home1.png', - num: 21, + num: 0, type: 'pending' }, { @@ -357,7 +331,7 @@ const taskTabList = ref([ color: '#DCCEFA', textColor: '#8600C5', icon: 'home2.png', - num: 2, + num:0, type: 'approved' }, { @@ -365,7 +339,7 @@ const taskTabList = ref([ color: '#FAE6CE', textColor: '#F47D0E', icon: 'home3.png', - num: 4, + num: 0, type: 'carryout' }, { @@ -373,7 +347,7 @@ const taskTabList = ref([ color: '#CEFAD8', textColor: '#01A089', icon: 'home4.png', - num: 1, + num: 0, type: 'check' } ]) @@ -549,20 +523,15 @@ const moneyPieOption = ref({ }) onMounted(async () => { + getTaskStatistics() getTodoList() getDoneList() await getFundChart() await getResearchChart() - // nextTick(() => { - // let topLeft=document.getElementById('topLeft') - // console.info("🚀 ~method:topLeft -----", topLeft.offsetHeight) - // topLeftHeight.value=topLeft.offsetHeight - // }) noticeList.value = await getArticleList(0) rulesList.value = await getArticleList(1) helpDocList.value = await getArticleList(2) problemList.value = await getArticleList(3) - // await initFundCharts() }) const handleGoToArticleDetail = (row) => { router.push({ @@ -598,6 +567,23 @@ const initFundCharts = () => { const initMoneyCharts = () => { data.moneyPieCharts = echarts.init(document.getElementById('moneyPie')).setOption(moneyPieOption.value) } + +const getTaskStatistics = () => { + getHomeStatistics().then(res => { + if (res.code === 1000) { + taskTabList.value[0].num = res.data.stayInitiation||0 + taskTabList.value[1].num = res.data.approvedProject||0 + taskTabList.value[2].num = res.data.implementation||0 + taskTabList.value[3].num = res.data.acceptanceCheck||0 + } else { + ElNotification({ + title: '提示', + message: res.msg, + type: 'error' + }) + } + }) +} const getTodoList = () => { getHomeTaskInfo().then(res => { if (res.code === 1000) {