feat: 添加登录,注册,忘记密码功能
This commit is contained in:
@@ -133,7 +133,7 @@ const transitionMain = defineComponent({
|
||||
}"
|
||||
>
|
||||
<el-backtop
|
||||
:title="t('buttons.pureBackTop')"
|
||||
:title="t('buttons:BackTop')"
|
||||
target=".app-main .el-scrollbar__wrap"
|
||||
>
|
||||
<BackTopIcon />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script lang="ts" setup>
|
||||
<script setup lang="ts">
|
||||
import { getConfig } from "@/config";
|
||||
|
||||
const TITLE = getConfig("Title");
|
||||
|
||||
@@ -24,6 +24,7 @@ const {
|
||||
userAvatar,
|
||||
avatarsStyle,
|
||||
toggleSideBar,
|
||||
toAccountSettings,
|
||||
getDropdownItemStyle,
|
||||
getDropdownItemClass
|
||||
} = useNav();
|
||||
@@ -94,19 +95,26 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="logout">
|
||||
<el-dropdown-item @click="toAccountSettings">
|
||||
<IconifyIconOffline
|
||||
:icon="AccountSettingsIcon"
|
||||
style="margin: 5px"
|
||||
/>
|
||||
{{ t("buttons:AccountSettings") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click="logout">
|
||||
<IconifyIconOffline
|
||||
:icon="LogoutCircleRLine"
|
||||
style="margin: 5px"
|
||||
/>
|
||||
{{ t("buttons.pureLoginOut") }}
|
||||
{{ t("buttons:LoginOut") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
:title="t('buttons:OpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
<IconifyIconOffline :icon="Setting" />
|
||||
|
||||
@@ -112,7 +112,7 @@ function hoverDescription(event, description) {
|
||||
max-width: 238px;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.notice-container {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
@@ -20,13 +20,13 @@ export interface TabItem {
|
||||
export const noticesData: TabItem[] = [
|
||||
{
|
||||
key: "1",
|
||||
name: $t("status.pureNotify"),
|
||||
name: $t("status:Notify"),
|
||||
list: [],
|
||||
emptyText: $t("status.pureNoNotify")
|
||||
emptyText: $t("status:NoNotify")
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
name: $t("status.pureMessage"),
|
||||
name: $t("status:Message"),
|
||||
list: [
|
||||
{
|
||||
avatar: "https://xiaoxian521.github.io/hyperlink/svg/smile1.svg",
|
||||
@@ -51,11 +51,11 @@ export const noticesData: TabItem[] = [
|
||||
type: "2"
|
||||
}
|
||||
],
|
||||
emptyText: $t("status.pureNoMessage")
|
||||
emptyText: $t("status:NoMessage")
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
name: $t("status.pureTodo"),
|
||||
name: $t("status:Todo"),
|
||||
list: [
|
||||
{
|
||||
avatar: "",
|
||||
@@ -94,6 +94,6 @@ export const noticesData: TabItem[] = [
|
||||
type: "3"
|
||||
}
|
||||
],
|
||||
emptyText: $t("status.pureNoTodo")
|
||||
emptyText: $t("status:NoTodo")
|
||||
}
|
||||
];
|
||||
|
||||
@@ -44,7 +44,7 @@ const getLabel = computed(
|
||||
>
|
||||
<el-empty
|
||||
v-if="notices.length === 0"
|
||||
:description="t('status.pureNoMessage')"
|
||||
:description="t('status:NoMessage')"
|
||||
:image-size="60"
|
||||
/>
|
||||
<span v-else>
|
||||
|
||||
@@ -54,11 +54,11 @@ onBeforeUnmount(() => {
|
||||
class="project-configuration border-b-[1px] border-solid border-[var(--pure-border-color)]"
|
||||
>
|
||||
<h4 class="dark:text-white">
|
||||
{{ t("panel.pureSystemSet") }}
|
||||
{{ t("panel:SystemSet") }}
|
||||
</h4>
|
||||
<span
|
||||
v-tippy="{
|
||||
content: t('panel.pureCloseSystemSet'),
|
||||
content: t('panel:CloseSystemSet'),
|
||||
placement: 'bottom-start',
|
||||
zIndex: 41000
|
||||
}"
|
||||
@@ -82,7 +82,7 @@ onBeforeUnmount(() => {
|
||||
>
|
||||
<el-button
|
||||
v-tippy="{
|
||||
content: t('panel.pureClearCacheAndToLogin'),
|
||||
content: t('panel:ClearCacheAndToLogin'),
|
||||
placement: 'left-start',
|
||||
zIndex: 41000
|
||||
}"
|
||||
@@ -91,7 +91,7 @@ onBeforeUnmount(() => {
|
||||
bg
|
||||
@click="onReset"
|
||||
>
|
||||
{{ t("panel.pureClearCache") }}
|
||||
{{ t("panel:ClearCache") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,19 +18,19 @@ const { device } = useNav();
|
||||
<div class="search-footer text-[#333] dark:text-white">
|
||||
<span class="search-footer-item">
|
||||
<EnterOutlined class="icon" />
|
||||
{{ t("buttons.pureConfirm") }}
|
||||
{{ t("buttons:Confirm") }}
|
||||
</span>
|
||||
<span class="search-footer-item">
|
||||
<IconifyIconOffline :icon="ArrowUpLine" class="icon" />
|
||||
<IconifyIconOffline :icon="ArrowDownLine" class="icon" />
|
||||
{{ t("buttons.pureSwitch") }}
|
||||
{{ t("buttons:Switch") }}
|
||||
</span>
|
||||
<span class="search-footer-item">
|
||||
<MdiKeyboardEsc class="icon" />
|
||||
{{ t("buttons.pureClose") }}
|
||||
{{ t("buttons:Close") }}
|
||||
</span>
|
||||
<p v-if="device !== 'mobile' && total > 0" class="search-footer-total">
|
||||
{{ `${t("search.pureTotal")} ${total}` }}
|
||||
{{ `${t("search:Total")} ${total}` }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -144,7 +144,7 @@ defineExpose({ handleScroll });
|
||||
<div ref="historyRef" class="history">
|
||||
<template v-if="historyList.length">
|
||||
<div :style="titleStyle">
|
||||
{{ t("search.pureHistory") }}
|
||||
{{ t("search:History") }}
|
||||
</div>
|
||||
<div
|
||||
v-for="(item, index) in historyList"
|
||||
@@ -165,7 +165,7 @@ defineExpose({ handleScroll });
|
||||
<template v-if="collectList.length">
|
||||
<div :style="titleStyle">
|
||||
{{
|
||||
`${t("search.pureCollect")}${collectList.length > 1 ? t("search.pureDragSort") : ""}`
|
||||
`${t("search:Collect")}${collectList.length > 1 ? t("search:DragSort") : ""}`
|
||||
}}
|
||||
</div>
|
||||
<div class="collect-container">
|
||||
|
||||
@@ -6,8 +6,8 @@ import { useRouter } from "vue-router";
|
||||
import SearchResult from "./SearchResult.vue";
|
||||
import SearchFooter from "./SearchFooter.vue";
|
||||
import { useNav } from "@/layout/hooks/useNav";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import SearchHistory from "./SearchHistory.vue";
|
||||
import { transformI18n, $t } from "@/plugins/i18n";
|
||||
import type { optionsItem, dragItem } from "../types";
|
||||
import { ref, computed, shallowRef, watch } from "vue";
|
||||
import { useDebounceFn, onKeyStroke } from "@vueuse/core";
|
||||
@@ -293,7 +293,7 @@ onKeyStroke("ArrowDown", handleDown);
|
||||
v-model="keyword"
|
||||
size="large"
|
||||
clearable
|
||||
:placeholder="t('search.purePlaceholder')"
|
||||
:placeholder="t('search:Placeholder')"
|
||||
@input="handleSearch"
|
||||
>
|
||||
<template #prefix>
|
||||
@@ -305,7 +305,7 @@ onKeyStroke("ArrowDown", handleDown);
|
||||
</el-input>
|
||||
<div class="search-content">
|
||||
<el-scrollbar ref="scrollbarRef" max-height="calc(90vh - 140px)">
|
||||
<el-empty v-if="showEmpty" :description="t('search.pureEmpty')" />
|
||||
<el-empty v-if="showEmpty" :description="t('search:Empty')" />
|
||||
<SearchHistory
|
||||
v-if="showSearchHistory"
|
||||
ref="historyRef"
|
||||
|
||||
@@ -147,13 +147,13 @@ function setFalse(Doms): any {
|
||||
const stretchTypeOptions = computed<Array<OptionsType>>(() => {
|
||||
return [
|
||||
{
|
||||
label: t("panel.pureStretchFixed"),
|
||||
tip: t("panel.pureStretchFixedTip"),
|
||||
label: t("panel:StretchFixed"),
|
||||
tip: t("panel:StretchFixedTip"),
|
||||
value: "fixed"
|
||||
},
|
||||
{
|
||||
label: t("panel.pureStretchCustom"),
|
||||
tip: t("panel.pureStretchCustomTip"),
|
||||
label: t("panel:StretchCustom"),
|
||||
tip: t("panel:StretchCustomTip"),
|
||||
value: "custom"
|
||||
}
|
||||
];
|
||||
@@ -195,24 +195,24 @@ const pClass = computed(() => {
|
||||
const themeOptions = computed<Array<OptionsType>>(() => {
|
||||
return [
|
||||
{
|
||||
label: t("panel.pureOverallStyleLight"),
|
||||
label: t("panel:OverallStyleLight"),
|
||||
icon: DayIcon,
|
||||
theme: "light",
|
||||
tip: t("panel.pureOverallStyleLightTip"),
|
||||
tip: t("panel:OverallStyleLightTip"),
|
||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||
},
|
||||
{
|
||||
label: t("panel.pureOverallStyleDark"),
|
||||
label: t("panel:OverallStyleDark"),
|
||||
icon: DarkIcon,
|
||||
theme: "dark",
|
||||
tip: t("panel.pureOverallStyleDarkTip"),
|
||||
tip: t("panel:OverallStyleDarkTip"),
|
||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||
},
|
||||
{
|
||||
label: t("panel.pureOverallStyleSystem"),
|
||||
label: t("panel:OverallStyleSystem"),
|
||||
icon: SystemIcon,
|
||||
theme: "system",
|
||||
tip: t("panel.pureOverallStyleSystemTip"),
|
||||
tip: t("panel:OverallStyleSystemTip"),
|
||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||
}
|
||||
];
|
||||
@@ -221,18 +221,18 @@ const themeOptions = computed<Array<OptionsType>>(() => {
|
||||
const markOptions = computed<Array<OptionsType>>(() => {
|
||||
return [
|
||||
{
|
||||
label: t("panel.pureTagsStyleSmart"),
|
||||
tip: t("panel.pureTagsStyleSmartTip"),
|
||||
label: t("panel:TagsStyleSmart"),
|
||||
tip: t("panel:TagsStyleSmartTip"),
|
||||
value: "smart"
|
||||
},
|
||||
{
|
||||
label: t("panel.pureTagsStyleCard"),
|
||||
tip: t("panel.pureTagsStyleCardTip"),
|
||||
label: t("panel:TagsStyleCard"),
|
||||
tip: t("panel:TagsStyleCardTip"),
|
||||
value: "card"
|
||||
},
|
||||
{
|
||||
label: t("panel.pureTagsStyleChrome"),
|
||||
tip: t("panel.pureTagsStyleChromeTip"),
|
||||
label: t("panel:TagsStyleChrome"),
|
||||
tip: t("panel:TagsStyleChromeTip"),
|
||||
value: "chrome"
|
||||
}
|
||||
];
|
||||
@@ -317,7 +317,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
<template>
|
||||
<LayPanel>
|
||||
<div class="p-5">
|
||||
<p :class="pClass">{{ t("panel.pureOverallStyle") }}</p>
|
||||
<p :class="pClass">{{ t("panel:OverallStyle") }}</p>
|
||||
<Segmented
|
||||
resize
|
||||
class="select-none"
|
||||
@@ -335,7 +335,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
"
|
||||
/>
|
||||
|
||||
<p :class="['mt-5', pClass]">{{ t("panel.pureThemeColor") }}</p>
|
||||
<p :class="['mt-5', pClass]">{{ t("panel:ThemeColor") }}</p>
|
||||
<ul class="theme-color">
|
||||
<li
|
||||
v-for="(item, index) in themeColors"
|
||||
@@ -354,12 +354,12 @@ onUnmounted(() => removeMatchMedia);
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p :class="['mt-5', pClass]">{{ t("panel.pureLayoutModel") }}</p>
|
||||
<p :class="['mt-5', pClass]">{{ t("panel:LayoutModel") }}</p>
|
||||
<ul class="pure-theme">
|
||||
<li
|
||||
ref="verticalRef"
|
||||
v-tippy="{
|
||||
content: t('panel.pureVerticalTip'),
|
||||
content: t('panel:VerticalTip'),
|
||||
zIndex: 41000
|
||||
}"
|
||||
:class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
|
||||
@@ -372,7 +372,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
v-if="device !== 'mobile'"
|
||||
ref="horizontalRef"
|
||||
v-tippy="{
|
||||
content: t('panel.pureHorizontalTip'),
|
||||
content: t('panel:HorizontalTip'),
|
||||
zIndex: 41000
|
||||
}"
|
||||
:class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
|
||||
@@ -385,7 +385,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
v-if="device !== 'mobile'"
|
||||
ref="mixRef"
|
||||
v-tippy="{
|
||||
content: t('panel.pureMixTip'),
|
||||
content: t('panel:MixTip'),
|
||||
zIndex: 41000
|
||||
}"
|
||||
:class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
|
||||
@@ -397,7 +397,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
</ul>
|
||||
|
||||
<span v-if="useAppStoreHook().getViewportWidth > 1280">
|
||||
<p :class="['mt-5', pClass]">{{ t("panel.pureStretch") }}</p>
|
||||
<p :class="['mt-5', pClass]">{{ t("panel:Stretch") }}</p>
|
||||
<Segmented
|
||||
resize
|
||||
class="mb-2 select-none"
|
||||
@@ -440,7 +440,7 @@ onUnmounted(() => removeMatchMedia);
|
||||
</button>
|
||||
</span>
|
||||
|
||||
<p :class="['mt-4', pClass]">{{ t("panel.pureTagsStyle") }}</p>
|
||||
<p :class="['mt-4', pClass]">{{ t("panel:TagsStyle") }}</p>
|
||||
<Segmented
|
||||
resize
|
||||
class="select-none"
|
||||
@@ -450,46 +450,46 @@ onUnmounted(() => removeMatchMedia);
|
||||
/>
|
||||
|
||||
<p class="mt-5 font-medium text-sm dark:text-white">
|
||||
{{ t("panel.pureInterfaceDisplay") }}
|
||||
{{ t("panel:InterfaceDisplay") }}
|
||||
</p>
|
||||
<ul class="setting">
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureGreyModel") }}</span>
|
||||
<span class="dark:text-white">{{ t("panel:GreyModel") }}</span>
|
||||
<el-switch
|
||||
v-model="settings.greyVal"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
:active-text="t('buttons:OpenText')"
|
||||
:inactive-text="t('buttons:CloseText')"
|
||||
@change="greyChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureWeakModel") }}</span>
|
||||
<span class="dark:text-white">{{ t("panel:WeakModel") }}</span>
|
||||
<el-switch
|
||||
v-model="settings.weakVal"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
:active-text="t('buttons:OpenText')"
|
||||
:inactive-text="t('buttons:CloseText')"
|
||||
@change="weekChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureHiddenTags") }}</span>
|
||||
<span class="dark:text-white">{{ t("panel:HiddenTags") }}</span>
|
||||
<el-switch
|
||||
v-model="settings.tabsVal"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
:active-text="t('buttons:OpenText')"
|
||||
:inactive-text="t('buttons:CloseText')"
|
||||
@change="tagsChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureHiddenFooter") }}</span>
|
||||
<span class="dark:text-white">{{ t("panel:HiddenFooter") }}</span>
|
||||
<el-switch
|
||||
v-model="settings.hideFooter"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
:active-text="t('buttons:OpenText')"
|
||||
:inactive-text="t('buttons:CloseText')"
|
||||
@change="hideFooterChange"
|
||||
/>
|
||||
</li>
|
||||
@@ -500,20 +500,20 @@ onUnmounted(() => removeMatchMedia);
|
||||
inline-prompt
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
:active-text="t('buttons:OpenText')"
|
||||
:inactive-text="t('buttons:CloseText')"
|
||||
@change="logoChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">
|
||||
{{ t("panel.pureMultiTagsCache") }}
|
||||
{{ t("panel:MultiTagsCache") }}
|
||||
</span>
|
||||
<el-switch
|
||||
v-model="settings.multiTagsCache"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
:active-text="t('buttons:OpenText')"
|
||||
:inactive-text="t('buttons:CloseText')"
|
||||
@change="multiTagsCacheChange"
|
||||
/>
|
||||
</li>
|
||||
|
||||
@@ -35,6 +35,7 @@ const {
|
||||
userAvatar,
|
||||
backTopMenu,
|
||||
avatarsStyle,
|
||||
toAccountSettings,
|
||||
getDropdownItemStyle,
|
||||
getDropdownItemClass
|
||||
} = useNav();
|
||||
@@ -121,20 +122,27 @@ onMounted(() => {
|
||||
<p v-if="username" class="dark:text-white">{{ username }}</p>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-item @click="toAccountSettings">
|
||||
<IconifyIconOffline
|
||||
:icon="AccountSettingsIcon"
|
||||
style="margin: 5px"
|
||||
/>
|
||||
{{ t("buttons:AccountSettings") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-menu class="logout">
|
||||
<el-dropdown-item @click="logout">
|
||||
<IconifyIconOffline
|
||||
:icon="LogoutCircleRLine"
|
||||
style="margin: 5px"
|
||||
/>
|
||||
{{ t("buttons.pureLoginOut") }}
|
||||
{{ t("buttons:LoginOut") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
:title="t('buttons:OpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
<IconifyIconOffline :icon="Setting" />
|
||||
|
||||
@@ -32,6 +32,7 @@ const {
|
||||
userAvatar,
|
||||
getDivStyle,
|
||||
avatarsStyle,
|
||||
toAccountSettings,
|
||||
getDropdownItemStyle,
|
||||
getDropdownItemClass
|
||||
} = useNav();
|
||||
@@ -142,20 +143,27 @@ watch(
|
||||
<p v-if="username" class="dark:text-white">{{ username }}</p>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-item @click="toAccountSettings">
|
||||
<IconifyIconOffline
|
||||
:icon="AccountSettingsIcon"
|
||||
style="margin: 5px"
|
||||
/>
|
||||
{{ t("buttons:AccountSettings") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-menu class="logout">
|
||||
<el-dropdown-item @click="logout">
|
||||
<IconifyIconOffline
|
||||
:icon="LogoutCircleRLine"
|
||||
style="margin: 5px"
|
||||
/>
|
||||
{{ t("buttons.pureLoginOut") }}
|
||||
{{ t("buttons:LoginOut") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
:title="t('buttons:OpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
<IconifyIconOffline :icon="Setting" />
|
||||
|
||||
@@ -36,9 +36,7 @@ const toggleClick = () => {
|
||||
<template>
|
||||
<div
|
||||
v-tippy="{
|
||||
content: isActive
|
||||
? t('buttons.pureClickCollapse')
|
||||
: t('buttons.pureClickExpand'),
|
||||
content: isActive ? t('buttons:ClickCollapse') : t('buttons:ClickExpand'),
|
||||
theme: tooltipEffect,
|
||||
hideOnClick: 'toggle',
|
||||
placement: 'right'
|
||||
|
||||
@@ -47,8 +47,8 @@ const toggleClick = () => {
|
||||
<IconifyIconOffline
|
||||
v-tippy="{
|
||||
content: isActive
|
||||
? t('buttons.pureClickCollapse')
|
||||
: t('buttons.pureClickExpand'),
|
||||
? t('buttons:ClickCollapse')
|
||||
: t('buttons:ClickExpand'),
|
||||
theme: tooltipEffect,
|
||||
hideOnClick: 'toggle',
|
||||
placement: 'right'
|
||||
|
||||
@@ -25,9 +25,7 @@ const toggleClick = () => {
|
||||
<template>
|
||||
<div
|
||||
class="px-3 mr-1 navbar-bg-hover"
|
||||
:title="
|
||||
isActive ? t('buttons.pureClickCollapse') : t('buttons.pureClickExpand')
|
||||
"
|
||||
:title="isActive ? t('buttons:ClickCollapse') : t('buttons:ClickExpand')"
|
||||
@click="toggleClick"
|
||||
>
|
||||
<IconifyIconOffline
|
||||
|
||||
@@ -344,10 +344,10 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
|
||||
setTimeout(() => {
|
||||
if (pureSetting.hiddenSideBar) {
|
||||
tagsViews[6].icon = ExitFullscreen;
|
||||
tagsViews[6].text = $t("buttons.pureContentExitFullScreen");
|
||||
tagsViews[6].text = $t("buttons:ContentExitFullScreen");
|
||||
} else {
|
||||
tagsViews[6].icon = Fullscreen;
|
||||
tagsViews[6].text = $t("buttons.pureContentFullScreen");
|
||||
tagsViews[6].text = $t("buttons:ContentFullScreen");
|
||||
}
|
||||
}, 100);
|
||||
break;
|
||||
@@ -511,6 +511,7 @@ function tagOnClick(item) {
|
||||
} else {
|
||||
router.push({ path });
|
||||
}
|
||||
emitter.emit("tagOnClick", item);
|
||||
}
|
||||
|
||||
onClickOutside(contextmenuRef, closeMenu, {
|
||||
|
||||
@@ -71,7 +71,7 @@ onMounted(() => {
|
||||
<div
|
||||
v-loading="loading"
|
||||
class="frame"
|
||||
:element-loading-text="t('status.pureLoad')"
|
||||
:element-loading-text="t('status:Load')"
|
||||
>
|
||||
<iframe ref="frameRef" :src="frameSrc" class="frame-iframe" />
|
||||
</div>
|
||||
|
||||
@@ -9,6 +9,10 @@ import { useAppStoreHook } from "@/store/modules/app";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||
import { darken, lighten, useGlobal, storageLocal } from "@pureadmin/utils";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { logoutAPI } from "@/api/login";
|
||||
import { message } from "@/utils/message";
|
||||
|
||||
export function useDataThemeChange() {
|
||||
const { layoutTheme, layout } = useLayout();
|
||||
@@ -110,17 +114,48 @@ export function useDataThemeChange() {
|
||||
|
||||
/** 清空缓存并返回登录页 */
|
||||
function onReset() {
|
||||
removeToken();
|
||||
storageLocal().clear();
|
||||
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } = getConfig();
|
||||
useAppStoreHook().setLayout(Layout);
|
||||
setEpThemeColor(EpThemeColor);
|
||||
useMultiTagsStoreHook().multiTagsCacheChange(MultiTagsCache);
|
||||
toggleClass(Grey, "html-grey", document.querySelector("html"));
|
||||
toggleClass(Weak, "html-weakness", document.querySelector("html"));
|
||||
router.push("/login");
|
||||
useMultiTagsStoreHook().handleTags("equal", [...routerArrays]);
|
||||
resetRouter();
|
||||
ElMessageBox.confirm(
|
||||
transformI18n("logout:message"),
|
||||
transformI18n("buttons:LoginOut"),
|
||||
{
|
||||
confirmButtonText: transformI18n("buttons:Confirm"),
|
||||
cancelButtonText: transformI18n("buttons:Cancel"),
|
||||
type: "warning",
|
||||
center: true
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
const res = await logoutAPI();
|
||||
if (!res.success) {
|
||||
removeToken();
|
||||
storageLocal().clear();
|
||||
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } =
|
||||
getConfig();
|
||||
useAppStoreHook().setLayout(Layout);
|
||||
setEpThemeColor(EpThemeColor);
|
||||
useMultiTagsStoreHook().multiTagsCacheChange(MultiTagsCache);
|
||||
toggleClass(Grey, "html-grey", document.querySelector("html"));
|
||||
toggleClass(Weak, "html-weakness", document.querySelector("html"));
|
||||
router.push("/login");
|
||||
useMultiTagsStoreHook().handleTags("equal", [...routerArrays]);
|
||||
resetRouter();
|
||||
message(transformI18n("logout:success"), {
|
||||
type: "success",
|
||||
duration: 1000
|
||||
});
|
||||
} else {
|
||||
message(transformI18n("logout:fail"), {
|
||||
type: "error",
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
message(transformI18n("logout:cancel"), {
|
||||
type: "info",
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { storeToRefs } from "pinia";
|
||||
import { getConfig } from "@/config";
|
||||
import { useRouter } from "vue-router";
|
||||
import { emitter } from "@/utils/mitt";
|
||||
import Avatar from "@/assets/user.jpg";
|
||||
import Avatar from "@/assets/user.png";
|
||||
import { getTopMenu } from "@/router/utils";
|
||||
import { useFullscreen } from "@vueuse/core";
|
||||
import type { routeMetaType } from "../types";
|
||||
@@ -14,9 +14,11 @@ import { useUserStoreHook } from "@/store/modules/user";
|
||||
import { useGlobal, isAllEmpty } from "@pureadmin/utils";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||
import { message } from "@/utils/message";
|
||||
import { logoutAPI } from "@/api/login";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
|
||||
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
|
||||
|
||||
const errorInfo =
|
||||
"The current routing configuration is incorrect, please check the configuration";
|
||||
|
||||
@@ -98,7 +100,37 @@ export function useNav() {
|
||||
|
||||
/** 退出登录 */
|
||||
function logout() {
|
||||
useUserStoreHook().logOut();
|
||||
ElMessageBox.confirm(
|
||||
transformI18n("logout:message"),
|
||||
transformI18n("buttons:LoginOut"),
|
||||
{
|
||||
confirmButtonText: transformI18n("buttons:Confirm"),
|
||||
cancelButtonText: transformI18n("buttons:Cancel"),
|
||||
type: "warning",
|
||||
center: true
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
const res = await logoutAPI();
|
||||
if (!res.success) {
|
||||
useUserStoreHook().logOut();
|
||||
message(transformI18n("logout:success"), {
|
||||
type: "success",
|
||||
duration: 1000
|
||||
});
|
||||
} else {
|
||||
message(transformI18n("logout:fail"), {
|
||||
type: "error",
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
message(transformI18n("logout:cancel"), {
|
||||
type: "info",
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function backTopMenu() {
|
||||
@@ -109,6 +141,10 @@ export function useNav() {
|
||||
emitter.emit("openPanel");
|
||||
}
|
||||
|
||||
function toAccountSettings() {
|
||||
router.push({ name: "AccountSettings" });
|
||||
}
|
||||
|
||||
function toggleSideBar() {
|
||||
pureApp.toggleSideBar();
|
||||
}
|
||||
@@ -169,6 +205,7 @@ export function useNav() {
|
||||
userAvatar,
|
||||
avatarsStyle,
|
||||
tooltipEffect,
|
||||
toAccountSettings,
|
||||
getDropdownItemStyle,
|
||||
getDropdownItemClass
|
||||
};
|
||||
|
||||
@@ -64,49 +64,49 @@ export function useTags() {
|
||||
const tagsViews = reactive<Array<tagsViewsType>>([
|
||||
{
|
||||
icon: RefreshRight,
|
||||
text: $t("buttons.pureReload"),
|
||||
text: $t("buttons:Reload"),
|
||||
divided: false,
|
||||
disabled: false,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
icon: Close,
|
||||
text: $t("buttons.pureCloseCurrentTab"),
|
||||
text: $t("buttons:CloseCurrentTab"),
|
||||
divided: false,
|
||||
disabled: multiTags.value.length > 1 ? false : true,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
icon: CloseLeftTags,
|
||||
text: $t("buttons.pureCloseLeftTabs"),
|
||||
text: $t("buttons:CloseLeftTabs"),
|
||||
divided: true,
|
||||
disabled: multiTags.value.length > 1 ? false : true,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
icon: CloseRightTags,
|
||||
text: $t("buttons.pureCloseRightTabs"),
|
||||
text: $t("buttons:CloseRightTabs"),
|
||||
divided: false,
|
||||
disabled: multiTags.value.length > 1 ? false : true,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
icon: CloseOtherTags,
|
||||
text: $t("buttons.pureCloseOtherTabs"),
|
||||
text: $t("buttons:CloseOtherTabs"),
|
||||
divided: true,
|
||||
disabled: multiTags.value.length > 2 ? false : true,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
icon: CloseAllTags,
|
||||
text: $t("buttons.pureCloseAllTabs"),
|
||||
text: $t("buttons:CloseAllTabs"),
|
||||
divided: false,
|
||||
disabled: multiTags.value.length > 1 ? false : true,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
icon: Fullscreen,
|
||||
text: $t("buttons.pureContentFullScreen"),
|
||||
text: $t("buttons:ContentFullScreen"),
|
||||
divided: true,
|
||||
disabled: false,
|
||||
show: true
|
||||
|
||||
@@ -188,7 +188,7 @@ const LayHeader = defineComponent({
|
||||
</div>
|
||||
<el-scrollbar v-else>
|
||||
<el-backtop
|
||||
:title="t('buttons.pureBackTop')"
|
||||
:title="t('buttons:BackTop')"
|
||||
target=".main-container .el-scrollbar__wrap"
|
||||
>
|
||||
<BackTopIcon />
|
||||
|
||||
@@ -7,7 +7,7 @@ export const routerArrays: Array<RouteConfigs> =
|
||||
{
|
||||
path: "/welcome",
|
||||
meta: {
|
||||
title: "menus.pureHome",
|
||||
title: "menus:Home",
|
||||
icon: "ep:home-filled"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user