feat: 首页待办和我的数量加载

This commit is contained in:
caoqianming 2025-11-24 16:04:17 +08:00
parent 9aeda011ce
commit 4ba51edb02
2 changed files with 16 additions and 3 deletions

View File

@ -12,13 +12,13 @@
<uni-col :span="12" style="border-radius: 20upx;"> <uni-col :span="12" style="border-radius: 20upx;">
<navigator class="middleNavigator" url="../wf/index?category=duty"> <navigator class="middleNavigator" url="../wf/index?category=duty">
<span>待办</span> <span>待办</span>
<span class="numSpan">3</span> <span class="numSpan">{{duty_count}}</span>
</navigator> </navigator>
</uni-col> </uni-col>
<uni-col :span="12"> <uni-col :span="12">
<navigator class="middleNavigator" url="../wf/index?category=owner"> <navigator class="middleNavigator" url="../wf/index?category=owner">
<span>我的</span> <span>我的</span>
<span class="numSpan">3</span> <span class="numSpan">{{owner_count}}</span>
</navigator> </navigator>
</uni-col> </uni-col>
</uni-row> </uni-row>
@ -48,7 +48,9 @@
welTitle: "", welTitle: "",
imageSrc:"", imageSrc:"",
currentDate: tool.getTodayDate(), currentDate: tool.getTodayDate(),
wfOptions: [] wfOptions: [],
duty_count: 0,
owner_count: 0
} }
}, },
mounted() { mounted() {
@ -59,8 +61,17 @@
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
uni.hideHomeButton() uni.hideHomeButton()
// #endif // #endif
this.getTicketCount();
}, },
methods: { methods: {
getTicketCount() {
this.$api.getTicket({category:"duty", page:1, page_size:1}).then(res=>{
this.duty_count = res.count;
})
this.$api.getTicket({category:"owner", page:1, page_size:1}).then(res=>{
this.owner_count = res.count;
})
},
getWfOptions() { getWfOptions() {
let permissions = auth.getPermissions(); let permissions = auth.getPermissions();
const groups = {}; const groups = {};
@ -146,6 +157,7 @@
color: #2979ff; color: #2979ff;
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
margin-left: 24rpx;
} }
.swiper { .swiper {

View File

@ -27,6 +27,7 @@ export default {
getTransition:(id) => http(`/wf/ticket/${id}/transitions/`, 'GET'), getTransition:(id) => http(`/wf/ticket/${id}/transitions/`, 'GET'),
workflowInitkey:(key) => http(`/wf/workflow/${key}/init_key/`, 'GET'), workflowInitkey:(key) => http(`/wf/workflow/${key}/init_key/`, 'GET'),
getMroom:(data) => http('/ofm/mroom/', 'GET', data), getMroom:(data) => http('/ofm/mroom/', 'GET', data),
//会议室预定 //会议室预定
bookingList:(data) => http('/ofm/mroombooking/', 'GET', data), bookingList:(data) => http('/ofm/mroombooking/', 'GET', data),