修改看板

master
夜笙歌 3 weeks ago
parent 34fed01699
commit b6719a1e80

@ -191,3 +191,25 @@ export const getNextNodeList = (data: any): any => {
data: data
});
};
/**
*
* @returns {Promise}
*/
export const countTaskWaitByCurrentUser = (): AxiosPromise<number> => {
return request({
url: '/workflow/task/countTaskWaitByCurrentUser',
method: 'get'
});
};
/**
*
* @returns {Promise}
*/
export const countTaskCopyByCurrentUser = (): AxiosPromise<number> => {
return request({
url: '/workflow/task/countTaskCopyByCurrentUser',
method: 'get'
});
};

@ -1,19 +1,41 @@
<template>
<el-menu :default-active="activeMenu" mode="horizontal" :ellipsis="false" @select="handleSelect">
<template v-for="(item, index) in topMenus">
<el-menu-item v-if="index < visibleNumber" :key="index" :style="{ '--theme': theme }" :index="item.path"
><svg-icon v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" :icon-class="item.meta ? item.meta.icon : ''" />
{{ item.meta?.title }}</el-menu-item
>
<el-menu-item v-if="index < visibleNumber" :key="index" :style="{ '--theme': theme }" :index="item.path">
<svg-icon v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"
:icon-class="item.meta ? item.meta.icon : ''" />
<span 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>{{ item.meta?.title }}</span>
</el-badge>
</el-menu-item>
</template>
<!-- 顶部菜单超出数量折叠 -->
<el-sub-menu v-if="topMenus.length > visibleNumber" :style="{ '--theme': theme }" index="more">
<template #title>更多菜单</template>
<template #title>
<span v-if="!topMenus.find(e=>e.meta?.title ==='我的任务')">
更多菜单
</span>
<el-badge v-if="topMenus.find(e=>e.meta?.title ==='我的任务')" :show-zero="false" :value="badge" type="primary"
:offset="[0, 10]">
<span>更多菜单</span>
</el-badge>
</template>
<template v-for="(item, index) in topMenus">
<el-menu-item v-if="index >= visibleNumber" :key="index" :index="item.path"
><svg-icon :icon-class="item.meta ? item.meta.icon : ''" /> {{ item.meta?.title }}</el-menu-item
>
<el-menu-item v-if="index >= visibleNumber" :key="index" :index="item.path">
<svg-icon :icon-class="item.meta ? item.meta.icon : ''" />
<span 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>{{ item.meta?.title }}</span>
</el-badge>
</el-menu-item>
</template>
</el-sub-menu>
</el-menu>
@ -26,6 +48,20 @@ import useAppStore from '@/store/modules/app';
import useSettingsStore from '@/store/modules/settings';
import usePermissionStore from '@/store/modules/permission';
import { RouteRecordRaw } from 'vue-router';
import { countTaskWaitByCurrentUser } from '@/api/workflow/task';
const badge = ref(1);
const getBadge = () => {
countTaskWaitByCurrentUser().then(e => {
badge.value = e.data;
});
};
onMounted(() => {
setInterval(() => {
getBadge();
}, 1000 * 10);
getBadge();
});
//
const visibleNumber = ref<number>(-1);

@ -1,11 +1,17 @@
<template>
<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)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
<svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" />
<template #title>
<span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span>
<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>
</el-badge>
</template>
</el-menu-item>
</app-link>
@ -14,7 +20,12 @@
<el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported>
<template v-if="item.meta" #title>
<svg-icon :icon-class="item.meta ? item.meta.icon : ''" />
<span class="menu-title" :title="hasTitle(item.meta?.title)">{{ item.meta?.title }}</span>
<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>
</el-badge>
</template>
<sidebar-item
@ -34,7 +45,22 @@ import { isExternal } from '@/utils/validate';
import AppLink from './Link.vue';
import { getNormalPath } from '@/utils/ruoyi';
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({
item: {
type: Object as PropType<RouteRecordRaw>,

@ -295,22 +295,24 @@
</el-dropdown>
</div>
<div class="level" v-for="i in nodes.filter(e=>e.type!=='area').reverse()">
<div class="isShow">
<el-icon style="cursor: pointer" color="#fff" :size="16">
<View />
</el-icon>
</div>
<div class="icon">
<svg viewBox="0 0 1024 1024" width="16" height="16"
style="margin-left: 10px;">
<path
d="M629.333333 160v768h-213.333333v-768h213.333333z m-277.333333 192v576h-213.333333v-576h213.333333z m554.666667 213.333333v362.666667h-213.333334v-362.666667h213.333334z m-341.333334-341.333333h-85.333333v640h85.333333v-640z m-277.333333 192h-85.333333v448h85.333333v-448z m554.666667 213.333333h-85.333334v234.666667h85.333334v-234.666667z"
fill="#ddd" p-id="10516"></path>
</svg>
</div>
<div class="boardName">
<span style=" display: inline-block;">{{ i.name }}</span>
<div class="levels">
<div class="level" v-for="i in nodes.filter(e=>e.type!=='area').reverse()">
<div class="isShow">
<el-icon style="cursor: pointer" color="#fff" :size="16">
<View />
</el-icon>
</div>
<div class="icon">
<svg viewBox="0 0 1024 1024" width="16" height="16"
style="margin-left: 10px;">
<path
d="M629.333333 160v768h-213.333333v-768h213.333333z m-277.333333 192v576h-213.333333v-576h213.333333z m554.666667 213.333333v362.666667h-213.333334v-362.666667h213.333334z m-341.333334-341.333333h-85.333333v640h85.333333v-640z m-277.333333 192h-85.333333v448h85.333333v-448z m554.666667 213.333333h-85.333334v234.666667h85.333334v-234.666667z"
fill="#ddd" p-id="10516"></path>
</svg>
</div>
<div class="boardName">
<span style=" display: inline-block;">{{ i.name }}</span>
</div>
</div>
</div>
</div>
@ -674,6 +676,7 @@ const selectTabs = (e) => {
z-index: -1 !important;
pointer-events: none !important;
}
.boardGenerate {
width: 100%;
height: 100%;
@ -701,36 +704,47 @@ const selectTabs = (e) => {
line-height: 50px;
text-align: center;
color: #FFF;
background-color: #293133;
border-bottom: 1px solid #000;
}
.level {
display: flex;
align-items: center; /* 核心对齐逻辑 */
height: 50px;
padding-left: 20px;
border-bottom: 1px solid #000;
.levels {
width: 100%;
height: calc(100% - 50px);
overflow: auto;
background-color: #1C1F20;
.isShow, .icon, .boardName {
.level {
display: flex;
align-items: center;
}
.isShow {
width: 30px;
height: 50px;
border-right: 1px solid #000;
}
padding-left: 20px;
border-bottom: 1px solid #000;
.icon {
width: 40px;
}
.isShow, .icon, .boardName {
display: flex;
align-items: center;
}
.boardName {
font-size: 14px;
color: #fff;
.isShow {
width: 30px;
min-width: 30px;
height: 50px;
border-right: 1px solid #000;
}
.icon {
width: 40px;
min-width: 40px;
}
.boardName {
font-size: 14px;
color: #fff;
}
}
}
}
.center {

Loading…
Cancel
Save