sidemenu service demand count.

This commit is contained in:
cxc
2022-11-21 16:40:21 +08:00
parent daba128033
commit 136574a8f4
8 changed files with 158 additions and 45 deletions

View File

@ -7,9 +7,6 @@
:value="getCount(basePath)"
class="count-badge"
>
<!-- <template #default>
<div>231</div>
</template> -->
<div>
<template
v-if="
@ -23,6 +20,9 @@
:to="resolvePath(onlyOneChild.path, onlyOneChild.query)"
>
<el-menu-item
:style="{
paddingRight: '0px',
}"
:index="resolvePath(onlyOneChild.path)"
:class="{ 'submenu-title-noDropdown': !isNest }"
>
@ -35,7 +35,11 @@
><span
class="menu-title"
:title="hasTitle(onlyOneChild.meta.title)"
>{{ onlyOneChild.meta.title }}</span
>{{
["/auditing/serviceDemand"].includes(basePath)
? `${onlyOneChild.meta.title} (${getCount(basePath)})`
: onlyOneChild.meta.title
}}</span
></template
>
</el-menu-item>
@ -95,11 +99,12 @@ const onlyOneChild = ref({});
const userStore = useUserStore();
const getCount = (basePath) => {
console.log(basePath);
if (basePath == "/approval/list") {
return userStore.unApprovedBusiness;
} else if (props.basePath == "/approval/dataList/approval") {
return userStore.unApprovedExpert;
} else if (props.basePath == "/auditing/serviceDemand") {
return userStore.serviceDemandTotal;
} else {
return 0;
}