修改看板

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

@ -191,3 +191,25 @@ export const getNextNodeList = (data: any): any => {
data: data 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> <template>
<el-menu :default-active="activeMenu" mode="horizontal" :ellipsis="false" @select="handleSelect"> <el-menu :default-active="activeMenu" mode="horizontal" :ellipsis="false" @select="handleSelect">
<template v-for="(item, index) in topMenus"> <template v-for="(item, index) in topMenus">
<el-menu-item v-if="index < visibleNumber" :key="index" :style="{ '--theme': theme }" :index="item.path" <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 : ''" /> <svg-icon v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"
{{ item.meta?.title }}</el-menu-item :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> </template>
<!-- 顶部菜单超出数量折叠 --> <!-- 顶部菜单超出数量折叠 -->
<el-sub-menu v-if="topMenus.length > visibleNumber" :style="{ '--theme': theme }" index="more"> <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"> <template v-for="(item, index) in topMenus">
<el-menu-item v-if="index >= visibleNumber" :key="index" :index="item.path" <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 <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> </template>
</el-sub-menu> </el-sub-menu>
</el-menu> </el-menu>
@ -26,6 +48,20 @@ import useAppStore from '@/store/modules/app';
import useSettingsStore from '@/store/modules/settings'; import useSettingsStore from '@/store/modules/settings';
import usePermissionStore from '@/store/modules/permission'; import usePermissionStore from '@/store/modules/permission';
import { RouteRecordRaw } from 'vue-router'; 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); const visibleNumber = ref<number>(-1);

@ -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" :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> </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)">{{ 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> </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>,

@ -295,22 +295,24 @@
</el-dropdown> </el-dropdown>
</div> </div>
<div class="level" v-for="i in nodes.filter(e=>e.type!=='area').reverse()"> <div class="levels">
<div class="isShow"> <div class="level" v-for="i in nodes.filter(e=>e.type!=='area').reverse()">
<el-icon style="cursor: pointer" color="#fff" :size="16"> <div class="isShow">
<View /> <el-icon style="cursor: pointer" color="#fff" :size="16">
</el-icon> <View />
</div> </el-icon>
<div class="icon"> </div>
<svg viewBox="0 0 1024 1024" width="16" height="16" <div class="icon">
style="margin-left: 10px;"> <svg viewBox="0 0 1024 1024" width="16" height="16"
<path style="margin-left: 10px;">
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" <path
fill="#ddd" p-id="10516"></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"
</svg> fill="#ddd" p-id="10516"></path>
</div> </svg>
<div class="boardName"> </div>
<span style=" display: inline-block;">{{ i.name }}</span> <div class="boardName">
<span style=" display: inline-block;">{{ i.name }}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -674,6 +676,7 @@ const selectTabs = (e) => {
z-index: -1 !important; z-index: -1 !important;
pointer-events: none !important; pointer-events: none !important;
} }
.boardGenerate { .boardGenerate {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -701,36 +704,47 @@ const selectTabs = (e) => {
line-height: 50px; line-height: 50px;
text-align: center; text-align: center;
color: #FFF; color: #FFF;
background-color: #293133;
border-bottom: 1px solid #000; border-bottom: 1px solid #000;
} }
.level { .levels {
display: flex; width: 100%;
align-items: center; /* 核心对齐逻辑 */ height: calc(100% - 50px);
height: 50px; overflow: auto;
padding-left: 20px; background-color: #1C1F20;
border-bottom: 1px solid #000;
.isShow, .icon, .boardName { .level {
display: flex; display: flex;
align-items: center; align-items: center;
}
.isShow {
width: 30px;
height: 50px; height: 50px;
border-right: 1px solid #000; padding-left: 20px;
} border-bottom: 1px solid #000;
.icon { .isShow, .icon, .boardName {
width: 40px; display: flex;
} align-items: center;
}
.boardName { .isShow {
font-size: 14px; width: 30px;
color: #fff; min-width: 30px;
height: 50px;
border-right: 1px solid #000;
}
.icon {
width: 40px;
min-width: 40px;
}
.boardName {
font-size: 14px;
color: #fff;
}
} }
} }
} }
.center { .center {

Loading…
Cancel
Save