优化
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
<template #title>
|
||||
<span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span>
|
||||
<span class="bage" v-if="onlyOneChild.meta?.title == '我的待办' && total > 0">{{ total }}</span>
|
||||
<span class="bage" v-if="onlyOneChild.meta?.title == '我的抄送' && totalChao > 0">{{ totalChao }}</span>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</app-link>
|
||||
@ -36,7 +37,7 @@ import { isExternal } from '@/utils/validate';
|
||||
import AppLink from './Link.vue';
|
||||
import { getNormalPath } from '@/utils/ruoyi';
|
||||
import { RouteRecordRaw } from 'vue-router';
|
||||
import { pageByTaskWait } from '@/api/workflow/task';
|
||||
import { pageByTaskWait, pageByTaskCopy } from '@/api/workflow/task';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import useNoticeStore from '@/store/modules/notice';
|
||||
const userStore = useUserStore();
|
||||
@ -56,21 +57,27 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
const total = ref(0);
|
||||
const totalChao = ref(0);
|
||||
onMounted(() => {
|
||||
if (onlyOneChild.value.meta?.title == '我的待办' || props.item.meta?.title == '我的任务') {
|
||||
console.log(44444444);
|
||||
if (onlyOneChild.value.meta?.title == '我的待办') {
|
||||
getWaitingList();
|
||||
}
|
||||
if (onlyOneChild.value.meta?.title == '我的抄送') {
|
||||
getChaoList();
|
||||
}
|
||||
});
|
||||
// 获取我的待办
|
||||
//分页
|
||||
const getWaitingList = () => {
|
||||
pageByTaskWait({ pageNum: 1, pageSize: 10 }).then((resp) => {
|
||||
console.log(resp);
|
||||
|
||||
total.value = resp.total;
|
||||
});
|
||||
};
|
||||
// 获取我的抄送
|
||||
const getChaoList = () => {
|
||||
pageByTaskCopy({ pageNum: 1, pageSize: 10 }).then((resp) => {
|
||||
totalChao.value = resp.total;
|
||||
});
|
||||
};
|
||||
const onlyOneChild = ref<any>({});
|
||||
|
||||
const hasOneShowingChild = (parent: RouteRecordRaw, children?: RouteRecordRaw[]) => {
|
||||
|
Reference in New Issue
Block a user