feat(web): 引入 Vite 前端应用并扩展仓库忽略规则 #2
@@ -22,12 +22,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="notice_title">{{ t('header.messageNotification') }}</div>
|
<div class="notice_title">{{ t('header.messageNotification') }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="logout-button" @click="handleLogout">
|
|
||||||
<div class="btn-box">
|
|
||||||
<img src="../images/login/btn.png" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="btn-name">{{ t('menu.logout') }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 通知弹框 -->
|
<!-- 通知弹框 -->
|
||||||
@@ -173,9 +167,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, watch, nextTick, computed } from "vue";
|
import { ref, reactive, watch, nextTick, computed } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { getTimesheetRouteName } from "../configs/common";
|
|
||||||
import { getNoticeList, getReadALl } from "../api/notice/notice";
|
import { getNoticeList, getReadALl } from "../api/notice/notice";
|
||||||
import { useUiStore } from "../store/ui";
|
import { useUiStore } from "../store/ui";
|
||||||
import InputText from "primevue/inputtext";
|
import InputText from "primevue/inputtext";
|
||||||
@@ -207,7 +199,6 @@ const showSearch = computed(() => props.showSearch);
|
|||||||
// 搜索框占位符:父组件传入则用传入值,否则用当前语言
|
// 搜索框占位符:父组件传入则用传入值,否则用当前语言
|
||||||
const searchPlaceholderDisplay = computed(() => props.searchPlaceholder || t('header.searchPlaceholder'));
|
const searchPlaceholderDisplay = computed(() => props.searchPlaceholder || t('header.searchPlaceholder'));
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const uiStore = useUiStore();
|
const uiStore = useUiStore();
|
||||||
const { isSidebarCollapsed } = storeToRefs(uiStore);
|
const { isSidebarCollapsed } = storeToRefs(uiStore);
|
||||||
@@ -218,16 +209,6 @@ const searchText = ref("");
|
|||||||
// 用户名 - 从 localStorage 获取
|
// 用户名 - 从 localStorage 获取
|
||||||
const userName = ref(localStorage.getItem("name") || "用户");
|
const userName = ref(localStorage.getItem("name") || "用户");
|
||||||
|
|
||||||
// 退出功能
|
|
||||||
const handleLogout = () => {
|
|
||||||
// 清除本地存储的 token、uid 和 name
|
|
||||||
localStorage.removeItem("token");
|
|
||||||
localStorage.removeItem("uid");
|
|
||||||
localStorage.removeItem("name");
|
|
||||||
// 跳转到登录页
|
|
||||||
router.push({ name: getTimesheetRouteName("Login") });
|
|
||||||
};
|
|
||||||
|
|
||||||
// 处理搜索
|
// 处理搜索
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
if (props.onSearch) {
|
if (props.onSearch) {
|
||||||
@@ -642,46 +623,6 @@ watch(noticeDialogVisible, async (newVal) => {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logout-button {
|
|
||||||
margin-right: 15px;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
min-width: 60px;
|
|
||||||
/* max-width: 120px; */
|
|
||||||
height: 36px;
|
|
||||||
padding: 0 12px;
|
|
||||||
background: #EFF4FF;
|
|
||||||
border-radius: 60px 60px 60px 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-button .btn-box {
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-button .btn-box img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-button .btn-name {
|
|
||||||
margin-left: 5px;
|
|
||||||
height: 20px;
|
|
||||||
font-family: Source Han Sans SC, Source Han Sans SC;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #3067E5;
|
|
||||||
text-align: left;
|
|
||||||
font-style: normal;
|
|
||||||
text-transform: none;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notice_box {
|
.notice_box {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user