Merge pull request 'feat : 首页项目四个状态统计' (#830) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/830
This commit is contained in:
2024-10-13 09:45:15 +00:00
2 changed files with 31 additions and 37 deletions

View File

@@ -21,3 +21,11 @@ export const getSpecialFundChart = () => {
method: "get" method: "get"
}); });
}; };
//获取首页四个统计数量
export const getHomeStatistics = () => {
return request({
url: '/workflow/mosr/process/task/statistics',
method: "get"
});
};

View File

@@ -43,13 +43,6 @@
<el-empty image-size="88" description="暂无待办数据~"/> <el-empty image-size="88" description="暂无待办数据~"/>
</div> </div>
<div v-for="item in todoList" class="todo-border"> <div v-for="item in todoList" class="todo-border">
<!-- <div class="status-style"-->
<!-- :style="{'background-color': item.status == 0 ? '#F55815' : item.status == 1 ? '#20BDA1' : '#4C52EA'}">-->
<!-- {{ item.status == 0 ? '加急' : item.status == 1 ? '正常' : '逾期' }}-->
<!-- </div>-->
<!-- <div class="status-style">-->
<!-- {{item.targetState}}-->
<!-- </div>-->
<div v-if="item.targetState !== null|| item.targetState !== undefined" style="margin-bottom: 10px"> <div v-if="item.targetState !== null|| item.targetState !== undefined" style="margin-bottom: 10px">
<Tag dictType="todo_type" :value="item.targetState"/> <Tag dictType="todo_type" :value="item.targetState"/>
</div> </div>
@@ -73,13 +66,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <fvTable ref="tableConfigBacklogRef" class="home-table" :tableConfig="tableConfigBacklog"-->
<!-- :pagination="false"-->
<!-- @getTotal="getTotal">-->
<!-- <template #empty>-->
<!-- <el-empty description="暂无待办"/>-->
<!-- </template>-->
<!-- </fvTable>-->
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="'已办(' + (doneList?.length||0) + ''" name="second"> <el-tab-pane :label="'已办(' + (doneList?.length||0) + ''" name="second">
<div class="todo-top"> <div class="todo-top">
@@ -101,10 +87,6 @@
<el-empty image-size="88" description="暂无已办数据~"/> <el-empty image-size="88" description="暂无已办数据~"/>
</div> </div>
<div v-for="item in doneList" class="todo-border"> <div v-for="item in doneList" class="todo-border">
<!-- <div class="status-style"-->
<!-- :style="{'background-color': item.status == 0 ? '#F55815' : item.status == 1 ? '#20BDA1' : '#4C52EA'}">-->
<!-- {{ item.status == 0 ? '加急' : item.status == 1 ? '正常' : '逾期' }}-->
<!-- </div>-->
<div v-if="item.targetState !== null|| item.targetState !== undefined" style="margin-bottom: 14px"> <div v-if="item.targetState !== null|| item.targetState !== undefined" style="margin-bottom: 14px">
<Tag dictType="todo_type" :value="item.targetState"/> <Tag dictType="todo_type" :value="item.targetState"/>
</div> </div>
@@ -128,12 +110,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <fvTable ref="tableConfigReportRef" :tableConfig="tableConfigReport" @getTotal="getReportNumTotal">-->
<!-- <template #empty>-->
<!-- <el-empty description="暂无数据"/>-->
<!-- </template>-->
<!-- </fvTable>-->
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
@@ -317,14 +293,12 @@ import {useAuthStore} from '@/stores/userstore.js'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import {toThousands} from "@/utils/changePrice.js"; import {toThousands} from "@/utils/changePrice.js";
import {ElNotification} from "element-plus"; 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 {getResearchFundChart} from "@/api/research-fund";
import {getArticle} from "@/api/article"; import {getArticle} from "@/api/article";
import {getSpecialFundChart} from "../../api/home";
const AuthStore = useAuthStore() const AuthStore = useAuthStore()
const router = useRouter() const router = useRouter()
const topLeftHeight = ref('')
const researchFundYear = ref(new Date().getFullYear() + '') const researchFundYear = ref(new Date().getFullYear() + '')
const activeName = ref('first') const activeName = ref('first')
const docActiveTab = ref('first') const docActiveTab = ref('first')
@@ -349,7 +323,7 @@ const taskTabList = ref([
color: '#CEE8FA', color: '#CEE8FA',
textColor: '#0043C5', textColor: '#0043C5',
icon: 'home1.png', icon: 'home1.png',
num: 21, num: 0,
type: 'pending' type: 'pending'
}, },
{ {
@@ -357,7 +331,7 @@ const taskTabList = ref([
color: '#DCCEFA', color: '#DCCEFA',
textColor: '#8600C5', textColor: '#8600C5',
icon: 'home2.png', icon: 'home2.png',
num: 2, num:0,
type: 'approved' type: 'approved'
}, },
{ {
@@ -365,7 +339,7 @@ const taskTabList = ref([
color: '#FAE6CE', color: '#FAE6CE',
textColor: '#F47D0E', textColor: '#F47D0E',
icon: 'home3.png', icon: 'home3.png',
num: 4, num: 0,
type: 'carryout' type: 'carryout'
}, },
{ {
@@ -373,7 +347,7 @@ const taskTabList = ref([
color: '#CEFAD8', color: '#CEFAD8',
textColor: '#01A089', textColor: '#01A089',
icon: 'home4.png', icon: 'home4.png',
num: 1, num: 0,
type: 'check' type: 'check'
} }
]) ])
@@ -549,20 +523,15 @@ const moneyPieOption = ref({
}) })
onMounted(async () => { onMounted(async () => {
getTaskStatistics()
getTodoList() getTodoList()
getDoneList() getDoneList()
await getFundChart() await getFundChart()
await getResearchChart() await getResearchChart()
// nextTick(() => {
// let topLeft=document.getElementById('topLeft')
// console.info("🚀 ~method:topLeft -----", topLeft.offsetHeight)
// topLeftHeight.value=topLeft.offsetHeight
// })
noticeList.value = await getArticleList(0) noticeList.value = await getArticleList(0)
rulesList.value = await getArticleList(1) rulesList.value = await getArticleList(1)
helpDocList.value = await getArticleList(2) helpDocList.value = await getArticleList(2)
problemList.value = await getArticleList(3) problemList.value = await getArticleList(3)
// await initFundCharts()
}) })
const handleGoToArticleDetail = (row) => { const handleGoToArticleDetail = (row) => {
router.push({ router.push({
@@ -598,6 +567,23 @@ const initFundCharts = () => {
const initMoneyCharts = () => { const initMoneyCharts = () => {
data.moneyPieCharts = echarts.init(document.getElementById('moneyPie')).setOption(moneyPieOption.value) 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 = () => { const getTodoList = () => {
getHomeTaskInfo().then(res => { getHomeTaskInfo().then(res => {
if (res.code === 1000) { if (res.code === 1000) {