-
+
diff --git a/src/layouts/components/navbar/components/right-side/style.scss b/src/layouts/components/navbar/components/right-side/style.scss
index 7910ada..cb690fe 100644
--- a/src/layouts/components/navbar/components/right-side/style.scss
+++ b/src/layouts/components/navbar/components/right-side/style.scss
@@ -23,4 +23,12 @@
}
}
}
+ .task-icon {
+ cursor: pointer;
+ background: rgba(255, 255, 255, 0.6);
+ transition: background 0.2s;
+ &:hover {
+ background: #fff;
+ }
+ }
}
diff --git a/src/layouts/components/siderBar/index.vue b/src/layouts/components/siderBar/index.vue
index 0923d58..3d1555f 100644
--- a/src/layouts/components/siderBar/index.vue
+++ b/src/layouts/components/siderBar/index.vue
@@ -26,6 +26,8 @@ export default defineComponent({
const currentRouteName = computed(() => route.name as string);
const currentRouteGroup = computed(() => route.meta?.group ?? 'GroupMain');
+ const isHomeRoute = computed(() => currentRouteName.value === 'Home');
+ const showAiSearch = computed(() => !route.meta?.hideAiSearch);
const getCollapseMenuKey = (routeName: string): string => {
let _key: string;
@@ -58,15 +60,27 @@ export default defineComponent({
};
const renderMenuItem = (item: typeMenuItem, hideLabel = false) => {
const getMenuItemClass = () => {
- if (item.children?.length) {
- return getCollapseMenuKey(currentRouteName.value) === item.key ? 'active' : '';
+ const hasChildren = item.children?.length;
+ let target = !hasChildren ? 'sub-menu-item ' : '';
+ if (hasChildren) {
+ target += getCollapseMenuKey(currentRouteName.value) === item.key ? 'active' : '';
+ } else {
+ target += item.activeMatch?.includes(currentRouteName.value) ? 'active' : '';
}
- return item.activeMatch?.includes(currentRouteName.value) ? 'active' : '';
+ return target;
};
return (
);
@@ -117,20 +131,31 @@ export default defineComponent({
initCollapse();
};
+ watch(
+ () => currentRouteGroup.value,
+ () => {
+ init();
+ },
+ { immediate: false, deep: true },
+ );
+
onMounted(() => {
init();
});
return () => (