feat: 将整体logo视觉替换为ai生成的logo
parent
6825193266
commit
6559b3eff2
@ -1,42 +1,42 @@
|
|||||||
// 根据角色动态生成路由
|
// 根据角色动态生成路由
|
||||||
import { defineFakeRoute } from "vite-plugin-fake-server/client";
|
import { defineFakeRoute } from 'vite-plugin-fake-server/client';
|
||||||
|
|
||||||
export default defineFakeRoute([
|
export default defineFakeRoute([
|
||||||
{
|
{
|
||||||
url: "/login",
|
url: '/login',
|
||||||
method: "post",
|
method: 'post',
|
||||||
response: ({ body }) => {
|
response: ({ body }) => {
|
||||||
if (body.username === "admin") {
|
if (body.username === 'admin') {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: {
|
||||||
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
avatar: '/user_small.png',
|
||||||
username: "admin",
|
username: 'admin',
|
||||||
nickname: "小铭",
|
nickname: 'Levi',
|
||||||
// 一个用户可能有多个角色
|
// 一个用户可能有多个角色
|
||||||
roles: ["admin"],
|
roles: ['admin'],
|
||||||
// 按钮级别权限
|
// 按钮级别权限
|
||||||
permissions: ["*:*:*"],
|
permissions: ['*:*:*'],
|
||||||
accessToken: "eyJhbGciOiJIUzUxMiJ9.admin",
|
accessToken: 'eyJhbGciOiJIUzUxMiJ9.admin',
|
||||||
refreshToken: "eyJhbGciOiJIUzUxMiJ9.adminRefresh",
|
refreshToken: 'eyJhbGciOiJIUzUxMiJ9.adminRefresh',
|
||||||
expires: "2030/10/30 00:00:00"
|
expires: '2030/10/30 00:00:00',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: {
|
||||||
avatar: "https://avatars.githubusercontent.com/u/52823142",
|
avatar: 'https://avatars.githubusercontent.com/u/52823142',
|
||||||
username: "common",
|
username: 'common',
|
||||||
nickname: "小林",
|
nickname: '小林',
|
||||||
roles: ["common"],
|
roles: ['common'],
|
||||||
permissions: ["permission:btn:add", "permission:btn:edit"],
|
permissions: ['permission:btn:add', 'permission:btn:edit'],
|
||||||
accessToken: "eyJhbGciOiJIUzUxMiJ9.common",
|
accessToken: 'eyJhbGciOiJIUzUxMiJ9.common',
|
||||||
refreshToken: "eyJhbGciOiJIUzUxMiJ9.commonRefresh",
|
refreshToken: 'eyJhbGciOiJIUzUxMiJ9.commonRefresh',
|
||||||
expires: "2030/10/30 00:00:00"
|
expires: '2030/10/30 00:00:00',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 96 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 235 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 96 KiB |
@ -1,96 +1,102 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from "vue";
|
import { ref, computed } from 'vue';
|
||||||
import { noticesData } from "./data";
|
import { noticesData } from './data';
|
||||||
import NoticeList from "./components/NoticeList.vue";
|
import NoticeList from './components/NoticeList.vue';
|
||||||
import BellIcon from "@iconify-icons/ep/bell";
|
import BellIcon from '@iconify-icons/ep/bell';
|
||||||
|
|
||||||
const noticesNum = ref(0);
|
const noticesNum = ref(0);
|
||||||
const notices = ref(noticesData);
|
const notices = ref([]);
|
||||||
|
// const notices = ref(noticesData);
|
||||||
const activeKey = ref(noticesData[0]?.key);
|
const activeKey = ref(noticesData[0]?.key);
|
||||||
|
|
||||||
notices.value.map(v => (noticesNum.value += v.list.length));
|
notices.value.map((v) => (noticesNum.value += v.list.length));
|
||||||
|
|
||||||
const getLabel = computed(
|
const getLabel = computed(() => (item) => item.name + (item.list.length > 0 ? `(${item.list.length})` : ''));
|
||||||
() => item =>
|
|
||||||
item.name + (item.list.length > 0 ? `(${item.list.length})` : "")
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-dropdown trigger="click" placement="bottom-end">
|
<el-dropdown
|
||||||
<span
|
trigger="click"
|
||||||
:class="[
|
placement="bottom-end"
|
||||||
'dropdown-badge',
|
|
||||||
'navbar-bg-hover',
|
|
||||||
'select-none',
|
|
||||||
Number(noticesNum) !== 0 && 'mr-[10px]'
|
|
||||||
]"
|
|
||||||
>
|
>
|
||||||
<el-badge :value="Number(noticesNum) === 0 ? '' : noticesNum" :max="99">
|
<span :class="['dropdown-badge', 'navbar-bg-hover', 'select-none', Number(noticesNum) !== 0 && 'mr-[10px]']">
|
||||||
<span class="header-notice-icon">
|
<el-badge
|
||||||
<IconifyIconOffline :icon="BellIcon" />
|
:value="Number(noticesNum) === 0 ? '' : noticesNum"
|
||||||
|
:max="99"
|
||||||
|
>
|
||||||
|
<span class="header-notice-icon">
|
||||||
|
<IconifyIconOffline :icon="BellIcon" />
|
||||||
|
</span>
|
||||||
|
</el-badge>
|
||||||
</span>
|
</span>
|
||||||
</el-badge>
|
<template #dropdown>
|
||||||
</span>
|
<el-dropdown-menu>
|
||||||
<template #dropdown>
|
<el-tabs
|
||||||
<el-dropdown-menu>
|
v-model="activeKey"
|
||||||
<el-tabs
|
:stretch="true"
|
||||||
v-model="activeKey"
|
class="dropdown-tabs"
|
||||||
:stretch="true"
|
:style="{ width: notices.length === 0 ? '200px' : '330px' }"
|
||||||
class="dropdown-tabs"
|
>
|
||||||
:style="{ width: notices.length === 0 ? '200px' : '330px' }"
|
<el-empty
|
||||||
>
|
v-if="notices.length === 0"
|
||||||
<el-empty
|
description="暂无消息"
|
||||||
v-if="notices.length === 0"
|
:image-size="60"
|
||||||
description="暂无消息"
|
/>
|
||||||
:image-size="60"
|
<span v-else>
|
||||||
/>
|
<template
|
||||||
<span v-else>
|
v-for="item in notices"
|
||||||
<template v-for="item in notices" :key="item.key">
|
:key="item.key"
|
||||||
<el-tab-pane :label="getLabel(item)" :name="`${item.key}`">
|
>
|
||||||
<el-scrollbar max-height="330px">
|
<el-tab-pane
|
||||||
<div class="noticeList-container">
|
:label="getLabel(item)"
|
||||||
<NoticeList :list="item.list" :emptyText="item.emptyText" />
|
:name="`${item.key}`"
|
||||||
</div>
|
>
|
||||||
</el-scrollbar>
|
<el-scrollbar max-height="330px">
|
||||||
</el-tab-pane>
|
<div class="noticeList-container">
|
||||||
</template>
|
<NoticeList
|
||||||
</span>
|
:list="item.list"
|
||||||
</el-tabs>
|
:emptyText="item.emptyText"
|
||||||
</el-dropdown-menu>
|
/>
|
||||||
</template>
|
</div>
|
||||||
</el-dropdown>
|
</el-scrollbar>
|
||||||
|
</el-tab-pane>
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
|
</el-tabs>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.dropdown-badge {
|
.dropdown-badge {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
.header-notice-icon {
|
.header-notice-icon {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-tabs {
|
.dropdown-tabs {
|
||||||
.noticeList-container {
|
.noticeList-container {
|
||||||
padding: 15px 24px 0;
|
padding: 15px 24px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-tabs__header) {
|
:deep(.el-tabs__header) {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-tabs__nav-wrap)::after {
|
:deep(.el-tabs__nav-wrap)::after {
|
||||||
height: 1px;
|
height: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-tabs__nav-wrap) {
|
:deep(.el-tabs__nav-wrap) {
|
||||||
padding: 0 36px;
|
padding: 0 36px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in New Issue