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) {