合并之前缺少部分

This commit is contained in:
muzi
2025-06-17 11:18:39 +08:00
parent a72487fe56
commit 384be13f46
32 changed files with 2394 additions and 220 deletions

View File

@ -3,6 +3,10 @@ import { useAppStore } from '@/stores';
import { IconExport, IconFile, IconCaretDown } from '@arco-design/web-vue/es/icon';
import { fetchMenusTree } from '@/api/all';
const lists = ref([]);
const router = useRouter();
const clickExit = () => {
router.replace('/login');
};
const getMenus = async () => {
const res = await fetchMenusTree();
lists.value = res;
@ -12,12 +16,6 @@ onMounted(() => {
});
const appStore = useAppStore();
const { isFullscreen, toggle: toggleFullScreen } = useFullscreen();
const avatar = computed(
() => '//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/dfdba5317c0c20ce20e64fac803d52bc.svg~tplv-49unhts6dw-image.image',
);
const topMenu = computed(() => appStore.topMenu && appStore.menu);
const toggleDrawerMenu = inject('toggleDrawerMenu') as () => void;
function setServerMenu() {
appStore.fetchServerMenuConfig();
@ -25,6 +23,29 @@ function setServerMenu() {
}
const handleSelect = (index: any) => {
console.log(index);
if (index == 0) {
router.push('/workplace');
} else {
router.push('/dataEngine/dataEngine/hotTranslation');
}
};
const handleDopdownClick = (index: any, ind: any) => {
let children = lists.value[index].children;
let indPath = children[ind];
if (indPath.name == '行业热门话题洞察') {
router.push('/dataEngine/dataEngine/hotTranslation');
} else if (indPath.name == '行业词云') {
router.push('/dataEngine/dataEngine/hotCloud');
} else if (indPath.name == '行业关键词动向') {
router.push('/dataEngine/dataEngine/keyWord');
} else if (indPath.name == '用户痛点观察') {
router.push('/dataEngine/dataEngine/userPainPoints');
} else if (indPath.name == '重点品牌动向') {
router.push('/dataEngine/dataEngine/keyBrandMovement');
} else if (indPath.name == '用户画像') {
router.push('/dataEngine/dataEngine/userPersona');
}
};
</script>
@ -32,20 +53,22 @@ const handleSelect = (index: any) => {
<div class="navbar">
<div class="left-side">
<a-space>
<img src="@/assets/LOGO.svg" alt="" />
<img src="@/assets/logo.svg" alt="" />
</a-space>
</div>
<div class="center-side">
<div class="menu-demo">
<a-menu mode="horizontal" :default-selected-keys="['1']">
<a-menu-item :key="'1'">
<a-menu-item :key="'1'" @click="handleSelect(0)">
<view>工作台</view>
</a-menu-item>
<a-menu-item v-for="(item, index) in lists" :key="index + 2">
<a-dropdown @select="handleSelect" :popup-max-height="false">
<a-dropdown :popup-max-height="false">
<a-button>{{ item.name }}<icon-caret-down /></a-button>
<template #content>
<a-doption v-for="(child, index) in item.children" :key="index">{{ child.name }}</a-doption>
<a-doption v-for="(child, ind) in item.children" :key="ind" @click="handleDopdownClick(index, ind)">{{
child.name
}}</a-doption>
</template>
</a-dropdown>
</a-menu-item>
@ -56,8 +79,33 @@ const handleSelect = (index: any) => {
<li>
<a-dropdown trigger="click">
<a-avatar class="cursor-pointer" :size="32">
<img alt="avatar" :src="avatar" />
<img alt="avatar" src="@/assets/avatar.svg" />
</a-avatar>
<template #content>
<div style="padding: 14px">
<a-doption>
<a-space @click="setServerMenu">
<img src="@/assets/option.svg" style="width: 16px; height: 16px" />
<span style="width: 140px; font-size: 12px">管理中心</span>
<icon-right />
</a-space>
</a-doption>
<a-doption>
<a-space>
<img src="@/assets/change.svg" style="width: 16px; height: 16px" />
<span style="width: 140px; font-size: 12px">切换企业账号</span>
<icon-right />
</a-space>
</a-doption>
<a-doption>
<a-space @click="clickExit">
<img src="@/assets/exit.svg" style="width: 16px; height: 16px" />
<span style="width: 140px; font-size: 12px">退出登录</span>
<icon-right />
</a-space>
</a-doption>
</div>
</template>
</a-dropdown>
</li>
</ul>