|
|
@ -1,11 +1,17 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div v-if="!item.hidden">
|
|
|
|
<div v-if="!item.hidden">
|
|
|
|
<template v-if="hasOneShowingChild(item, item.children) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
|
|
|
|
<template
|
|
|
|
|
|
|
|
v-if="hasOneShowingChild(item, item.children) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
|
|
|
|
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
|
|
|
|
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
|
|
|
|
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
|
|
|
|
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
|
|
|
|
<svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" />
|
|
|
|
<svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" />
|
|
|
|
<template #title>
|
|
|
|
<template #title>
|
|
|
|
|
|
|
|
<span class="menu-title" v-if="onlyOneChild.meta.title !=='我的待办'"
|
|
|
|
|
|
|
|
:title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span>
|
|
|
|
|
|
|
|
<el-badge :show-zero="false" :value="badge" type="primary" v-if="onlyOneChild.meta.title ==='我的待办'"
|
|
|
|
|
|
|
|
:offset="[0, 10]">
|
|
|
|
<span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span>
|
|
|
|
<span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span>
|
|
|
|
|
|
|
|
</el-badge>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-menu-item>
|
|
|
|
</el-menu-item>
|
|
|
|
</app-link>
|
|
|
|
</app-link>
|
|
|
@ -14,7 +20,12 @@
|
|
|
|
<el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported>
|
|
|
|
<el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported>
|
|
|
|
<template v-if="item.meta" #title>
|
|
|
|
<template v-if="item.meta" #title>
|
|
|
|
<svg-icon :icon-class="item.meta ? item.meta.icon : ''" />
|
|
|
|
<svg-icon :icon-class="item.meta ? item.meta.icon : ''" />
|
|
|
|
|
|
|
|
<span class="menu-title" :title="hasTitle(item.meta?.title)"
|
|
|
|
|
|
|
|
v-if="item.meta?.title !=='我的任务'">{{ item.meta?.title }}</span>
|
|
|
|
|
|
|
|
<el-badge :show-zero="false" :value="badge" type="primary" v-if="item.meta?.title ==='我的任务'"
|
|
|
|
|
|
|
|
:offset="[0, 10]">
|
|
|
|
<span class="menu-title" :title="hasTitle(item.meta?.title)">{{ item.meta?.title }}</span>
|
|
|
|
<span class="menu-title" :title="hasTitle(item.meta?.title)">{{ item.meta?.title }}</span>
|
|
|
|
|
|
|
|
</el-badge>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<sidebar-item
|
|
|
|
<sidebar-item
|
|
|
@ -34,7 +45,22 @@ import { isExternal } from '@/utils/validate';
|
|
|
|
import AppLink from './Link.vue';
|
|
|
|
import AppLink from './Link.vue';
|
|
|
|
import { getNormalPath } from '@/utils/ruoyi';
|
|
|
|
import { getNormalPath } from '@/utils/ruoyi';
|
|
|
|
import { RouteRecordRaw } from 'vue-router';
|
|
|
|
import { RouteRecordRaw } from 'vue-router';
|
|
|
|
|
|
|
|
import { countTaskWaitByCurrentUser } from '@/api/workflow/task';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const badge = ref(0);
|
|
|
|
|
|
|
|
const getBadge = () => {
|
|
|
|
|
|
|
|
if (onlyOneChild.value.meta?.title === '我的待办' || props.item?.meta?.title === '我的任务') {
|
|
|
|
|
|
|
|
countTaskWaitByCurrentUser().then(e => {
|
|
|
|
|
|
|
|
badge.value = e.data;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
|
|
|
getBadge();
|
|
|
|
|
|
|
|
}, 1000 * 10);
|
|
|
|
|
|
|
|
getBadge();
|
|
|
|
|
|
|
|
});
|
|
|
|
const props = defineProps({
|
|
|
|
const props = defineProps({
|
|
|
|
item: {
|
|
|
|
item: {
|
|
|
|
type: Object as PropType<RouteRecordRaw>,
|
|
|
|
type: Object as PropType<RouteRecordRaw>,
|
|
|
|