mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-07 17:07:19 +08:00
fix: update
This commit is contained in:
parent
c7955bcc19
commit
0d4fe313b4
@ -7,7 +7,7 @@ import avatars from "/@/assets/avatars.jpg";
|
|||||||
import Breadcrumb from "./sidebar/breadCrumb.vue";
|
import Breadcrumb from "./sidebar/breadCrumb.vue";
|
||||||
import { deviceDetection } from "@pureadmin/utils";
|
import { deviceDetection } from "@pureadmin/utils";
|
||||||
import screenfull from "../components/screenfull/index.vue";
|
import screenfull from "../components/screenfull/index.vue";
|
||||||
import useTranslationLang from "../hooks/useTranslationLang";
|
import { useTranslationLang } from "../hooks/useTranslationLang";
|
||||||
import globalization from "/@/assets/svg/globalization.svg?component";
|
import globalization from "/@/assets/svg/globalization.svg?component";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { SearchModal } from "./components";
|
import { SearchModal } from "./components";
|
||||||
import useBoolean from "../../hooks/useBoolean";
|
import { useBoolean } from "../../hooks/useBoolean";
|
||||||
const { bool: show, toggle } = useBoolean();
|
const { bool: show, toggle } = useBoolean();
|
||||||
function handleSearch() {
|
function handleSearch() {
|
||||||
toggle();
|
toggle();
|
||||||
|
@ -15,9 +15,8 @@ import { emitter } from "/@/utils/mitt";
|
|||||||
import { templateRef } from "@vueuse/core";
|
import { templateRef } from "@vueuse/core";
|
||||||
import { routerArrays } from "/@/layout/types";
|
import { routerArrays } from "/@/layout/types";
|
||||||
import { useAppStoreHook } from "/@/store/modules/app";
|
import { useAppStoreHook } from "/@/store/modules/app";
|
||||||
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
|
|
||||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
||||||
import useDataThemeChange from "/@/layout/hooks/useDataThemeChange";
|
import { useDataThemeChange } from "/@/layout/hooks/useDataThemeChange";
|
||||||
import {
|
import {
|
||||||
useDark,
|
useDark,
|
||||||
debounce,
|
debounce,
|
||||||
@ -44,6 +43,7 @@ const {
|
|||||||
layoutTheme,
|
layoutTheme,
|
||||||
themeColors,
|
themeColors,
|
||||||
dataThemeChange,
|
dataThemeChange,
|
||||||
|
setEpThemeColor,
|
||||||
setLayoutThemeColor
|
setLayoutThemeColor
|
||||||
} = useDataThemeChange();
|
} = useDataThemeChange();
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ function onReset() {
|
|||||||
router.push("/login");
|
router.push("/login");
|
||||||
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } = getConfig();
|
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } = getConfig();
|
||||||
useAppStoreHook().setLayout(Layout);
|
useAppStoreHook().setLayout(Layout);
|
||||||
useEpThemeStoreHook().setEpThemeColor(EpThemeColor);
|
setEpThemeColor(EpThemeColor);
|
||||||
useMultiTagsStoreHook().multiTagsCacheChange(MultiTagsCache);
|
useMultiTagsStoreHook().multiTagsCacheChange(MultiTagsCache);
|
||||||
toggleClass(Grey, "html-grey", document.querySelector("html"));
|
toggleClass(Grey, "html-grey", document.querySelector("html"));
|
||||||
toggleClass(Weak, "html-weakness", document.querySelector("html"));
|
toggleClass(Weak, "html-weakness", document.querySelector("html"));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
export default function useBoolean(initValue = false) {
|
export function useBoolean(initValue = false) {
|
||||||
const bool = ref(initValue);
|
const bool = ref(initValue);
|
||||||
|
|
||||||
function setBool(value: boolean) {
|
function setBool(value: boolean) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { getConfig } from "/@/config";
|
import { getConfig } from "/@/config";
|
||||||
import { find } from "lodash-unified";
|
import { find } from "lodash-unified";
|
||||||
import useLayout from "./useLayout";
|
import { useLayout } from "./useLayout";
|
||||||
import { themeColorsType } from "../types";
|
import { themeColorsType } from "../types";
|
||||||
import { TinyColor } from "@ctrl/tinycolor";
|
import { TinyColor } from "@ctrl/tinycolor";
|
||||||
import { ref, getCurrentInstance } from "vue";
|
import { ref, getCurrentInstance } from "vue";
|
||||||
@ -12,7 +12,7 @@ import {
|
|||||||
toggleTheme
|
toggleTheme
|
||||||
} from "@pureadmin/theme/dist/browser-utils";
|
} from "@pureadmin/theme/dist/browser-utils";
|
||||||
|
|
||||||
export default function useDataThemeChange() {
|
export function useDataThemeChange() {
|
||||||
const { layoutTheme } = useLayout();
|
const { layoutTheme } = useLayout();
|
||||||
const themeColors = ref<Array<themeColorsType>>([
|
const themeColors = ref<Array<themeColorsType>>([
|
||||||
/* 道奇蓝(默认) */
|
/* 道奇蓝(默认) */
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { computed, getCurrentInstance } from "vue";
|
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { routerArrays } from "../types";
|
import { routerArrays } from "../types";
|
||||||
|
import { computed, getCurrentInstance } from "vue";
|
||||||
import { useMultiTagsStore } from "/@/store/modules/multiTags";
|
import { useMultiTagsStore } from "/@/store/modules/multiTags";
|
||||||
|
|
||||||
export default function useLayout() {
|
export function useLayout() {
|
||||||
const instance = getCurrentInstance().appContext.app.config.globalProperties;
|
const instance = getCurrentInstance().appContext.app.config.globalProperties;
|
||||||
|
|
||||||
const initStorage = () => {
|
const initStorage = () => {
|
||||||
|
@ -3,7 +3,7 @@ import { useI18n } from "vue-i18n";
|
|||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { watch, getCurrentInstance } from "vue";
|
import { watch, getCurrentInstance } from "vue";
|
||||||
|
|
||||||
export default function useTranslationLang() {
|
export function useTranslationLang() {
|
||||||
const { changeTitle, changeWangeditorLanguage } = useNav();
|
const { changeTitle, changeWangeditorLanguage } = useNav();
|
||||||
const { locale, t } = useI18n();
|
const { locale, t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { setType } from "./types";
|
import { setType } from "./types";
|
||||||
import { emitter } from "/@/utils/mitt";
|
import { emitter } from "/@/utils/mitt";
|
||||||
|
import { useLayout } from "./hooks/useLayout";
|
||||||
import { useAppStoreHook } from "/@/store/modules/app";
|
import { useAppStoreHook } from "/@/store/modules/app";
|
||||||
import { deviceDetection, useDark } from "@pureadmin/utils";
|
import { deviceDetection, useDark } from "@pureadmin/utils";
|
||||||
import { useSettingStoreHook } from "/@/store/modules/settings";
|
import { useSettingStoreHook } from "/@/store/modules/settings";
|
||||||
@ -10,7 +11,6 @@ import backTop from "/@/assets/svg/back_top.svg?component";
|
|||||||
import fullScreen from "/@/assets/svg/full_screen.svg?component";
|
import fullScreen from "/@/assets/svg/full_screen.svg?component";
|
||||||
import exitScreen from "/@/assets/svg/exit_screen.svg?component";
|
import exitScreen from "/@/assets/svg/exit_screen.svg?component";
|
||||||
|
|
||||||
import useLayout from "./hooks/useLayout";
|
|
||||||
import navbar from "./components/navbar.vue";
|
import navbar from "./components/navbar.vue";
|
||||||
import tag from "./components/tag/index.vue";
|
import tag from "./components/tag/index.vue";
|
||||||
import appMain from "./components/appMain.vue";
|
import appMain from "./components/appMain.vue";
|
||||||
|
@ -10,15 +10,15 @@ import { initRouter } from "/@/router/utils";
|
|||||||
import { useNav } from "/@/layout/hooks/nav";
|
import { useNav } from "/@/layout/hooks/nav";
|
||||||
import { message } from "@pureadmin/components";
|
import { message } from "@pureadmin/components";
|
||||||
import type { FormInstance } from "element-plus";
|
import type { FormInstance } from "element-plus";
|
||||||
import useLayout from "/@/layout/hooks/useLayout";
|
|
||||||
import { storageSession } from "@pureadmin/utils";
|
import { storageSession } from "@pureadmin/utils";
|
||||||
import { operates, thirdParty } from "./utils/enums";
|
import { operates, thirdParty } from "./utils/enums";
|
||||||
|
import { useLayout } from "/@/layout/hooks/useLayout";
|
||||||
import { useUserStoreHook } from "/@/store/modules/user";
|
import { useUserStoreHook } from "/@/store/modules/user";
|
||||||
import { bg, avatar, currentWeek } from "./utils/static";
|
import { bg, avatar, currentWeek } from "./utils/static";
|
||||||
import { ReImageVerify } from "/@/components/ReImageVerify";
|
import { ReImageVerify } from "/@/components/ReImageVerify";
|
||||||
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
||||||
import useDataThemeChange from "/@/layout/hooks/useDataThemeChange";
|
import { useTranslationLang } from "/@/layout/hooks/useTranslationLang";
|
||||||
import useTranslationLang from "/@/layout/hooks/useTranslationLang";
|
import { useDataThemeChange } from "/@/layout/hooks/useDataThemeChange";
|
||||||
import { ref, reactive, watch, computed, getCurrentInstance } from "vue";
|
import { ref, reactive, watch, computed, getCurrentInstance } from "vue";
|
||||||
|
|
||||||
import dayIcon from "/@/assets/svg/day.svg?component";
|
import dayIcon from "/@/assets/svg/day.svg?component";
|
||||||
@ -82,178 +82,184 @@ function onHandle(value) {
|
|||||||
watch(imgCode, value => {
|
watch(imgCode, value => {
|
||||||
useUserStoreHook().SET_VERIFYCODE(value);
|
useUserStoreHook().SET_VERIFYCODE(value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dataThemeChange();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex-c absolute right-5">
|
<div class="wh-full select-none">
|
||||||
<!-- 主题 -->
|
<img :src="bg" class="wave" />
|
||||||
<el-switch
|
<div class="flex-c absolute right-5 top-3">
|
||||||
v-model="dataTheme"
|
<!-- 主题 -->
|
||||||
inline-prompt
|
<el-switch
|
||||||
:active-icon="dayIcon"
|
v-model="dataTheme"
|
||||||
:inactive-icon="darkIcon"
|
inline-prompt
|
||||||
@change="dataThemeChange"
|
:active-icon="dayIcon"
|
||||||
/>
|
:inactive-icon="darkIcon"
|
||||||
<!-- 国际化 -->
|
@change="dataThemeChange"
|
||||||
<el-dropdown trigger="click">
|
/>
|
||||||
<globalization class="w-40px h-48px p-11px cursor-pointer outline-none" />
|
<!-- 国际化 -->
|
||||||
<template #dropdown>
|
<el-dropdown trigger="click">
|
||||||
<el-dropdown-menu class="translation">
|
<globalization
|
||||||
<el-dropdown-item
|
class="hover:color-primary !hover:bg-transparent w-20px h-20px ml-1.5 cursor-pointer outline-none duration-300"
|
||||||
:style="getDropdownItemStyle(locale, 'zh')"
|
/>
|
||||||
:class="['!dark:color-white', getDropdownItemClass(locale, 'zh')]"
|
<template #dropdown>
|
||||||
@click="translationCh"
|
<el-dropdown-menu class="translation">
|
||||||
>
|
<el-dropdown-item
|
||||||
<IconifyIconOffline
|
:style="getDropdownItemStyle(locale, 'zh')"
|
||||||
class="check-zh"
|
:class="['!dark:color-white', getDropdownItemClass(locale, 'zh')]"
|
||||||
v-show="locale === 'zh'"
|
@click="translationCh"
|
||||||
icon="check"
|
>
|
||||||
/>
|
<IconifyIconOffline
|
||||||
简体中文
|
class="check-zh"
|
||||||
</el-dropdown-item>
|
v-show="locale === 'zh'"
|
||||||
<el-dropdown-item
|
icon="check"
|
||||||
:style="getDropdownItemStyle(locale, 'en')"
|
/>
|
||||||
:class="['!dark:color-white', getDropdownItemClass(locale, 'en')]"
|
简体中文
|
||||||
@click="translationEn"
|
</el-dropdown-item>
|
||||||
>
|
<el-dropdown-item
|
||||||
<span class="check-en" v-show="locale === 'en'">
|
:style="getDropdownItemStyle(locale, 'en')"
|
||||||
<IconifyIconOffline icon="check" />
|
:class="['!dark:color-white', getDropdownItemClass(locale, 'en')]"
|
||||||
</span>
|
@click="translationEn"
|
||||||
English
|
>
|
||||||
</el-dropdown-item>
|
<span class="check-en" v-show="locale === 'en'">
|
||||||
</el-dropdown-menu>
|
<IconifyIconOffline icon="check" />
|
||||||
</template>
|
</span>
|
||||||
</el-dropdown>
|
English
|
||||||
</div>
|
</el-dropdown-item>
|
||||||
<img :src="bg" class="wave" />
|
</el-dropdown-menu>
|
||||||
<div class="login-container">
|
</template>
|
||||||
<div class="img">
|
</el-dropdown>
|
||||||
<component :is="currentWeek" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="login-box">
|
<div class="login-container">
|
||||||
<div class="login-form">
|
<div class="img">
|
||||||
<avatar class="avatar" />
|
<component :is="currentWeek" />
|
||||||
<Motion>
|
</div>
|
||||||
<h2>{{ title }}</h2>
|
<div class="login-box">
|
||||||
</Motion>
|
<div class="login-form">
|
||||||
|
<avatar class="avatar" />
|
||||||
<el-form
|
<Motion>
|
||||||
v-if="currentPage === 0"
|
<h2 class="outline-none">{{ title }}</h2>
|
||||||
ref="ruleFormRef"
|
|
||||||
:model="ruleForm"
|
|
||||||
:rules="loginRules"
|
|
||||||
size="large"
|
|
||||||
@keyup.enter="onLogin(ruleFormRef)"
|
|
||||||
>
|
|
||||||
<Motion :delay="100">
|
|
||||||
<el-form-item prop="username">
|
|
||||||
<el-input
|
|
||||||
clearable
|
|
||||||
v-model="ruleForm.username"
|
|
||||||
placeholder="账号"
|
|
||||||
:prefix-icon="useRenderIcon('user')"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</Motion>
|
</Motion>
|
||||||
|
|
||||||
<Motion :delay="150">
|
<el-form
|
||||||
<el-form-item prop="password">
|
v-if="currentPage === 0"
|
||||||
<el-input
|
ref="ruleFormRef"
|
||||||
clearable
|
:model="ruleForm"
|
||||||
show-password
|
:rules="loginRules"
|
||||||
v-model="ruleForm.password"
|
size="large"
|
||||||
placeholder="密码"
|
@keyup.enter="onLogin(ruleFormRef)"
|
||||||
:prefix-icon="useRenderIcon('lock')"
|
>
|
||||||
/>
|
<Motion :delay="100">
|
||||||
</el-form-item>
|
<el-form-item prop="username">
|
||||||
</Motion>
|
<el-input
|
||||||
|
clearable
|
||||||
|
v-model="ruleForm.username"
|
||||||
|
placeholder="账号"
|
||||||
|
:prefix-icon="useRenderIcon('user')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</Motion>
|
||||||
|
|
||||||
<Motion :delay="200">
|
<Motion :delay="150">
|
||||||
<el-form-item prop="verifyCode">
|
<el-form-item prop="password">
|
||||||
<el-input
|
<el-input
|
||||||
clearable
|
clearable
|
||||||
v-model="ruleForm.verifyCode"
|
show-password
|
||||||
placeholder="验证码"
|
v-model="ruleForm.password"
|
||||||
:prefix-icon="
|
placeholder="密码"
|
||||||
useRenderIcon('ri:shield-keyhole-line', { online: true })
|
:prefix-icon="useRenderIcon('lock')"
|
||||||
"
|
/>
|
||||||
>
|
</el-form-item>
|
||||||
<template v-slot:append>
|
</Motion>
|
||||||
<ReImageVerify v-model:code="imgCode" />
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</Motion>
|
|
||||||
|
|
||||||
<Motion :delay="250">
|
<Motion :delay="200">
|
||||||
<el-form-item>
|
<el-form-item prop="verifyCode">
|
||||||
<div class="w-full h-20px flex justify-between items-center">
|
<el-input
|
||||||
<el-checkbox v-model="checked">记住密码</el-checkbox>
|
clearable
|
||||||
<el-button
|
v-model="ruleForm.verifyCode"
|
||||||
link
|
placeholder="验证码"
|
||||||
type="primary"
|
:prefix-icon="
|
||||||
@click="useUserStoreHook().SET_CURRENTPAGE(4)"
|
useRenderIcon('ri:shield-keyhole-line', { online: true })
|
||||||
|
"
|
||||||
>
|
>
|
||||||
忘记密码?
|
<template v-slot:append>
|
||||||
</el-button>
|
<ReImageVerify v-model:code="imgCode" />
|
||||||
</div>
|
</template>
|
||||||
<el-button
|
</el-input>
|
||||||
class="w-full mt-4"
|
</el-form-item>
|
||||||
size="default"
|
</Motion>
|
||||||
type="primary"
|
|
||||||
:loading="loading"
|
|
||||||
@click="onLogin(ruleFormRef)"
|
|
||||||
>
|
|
||||||
登录
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</Motion>
|
|
||||||
|
|
||||||
<Motion :delay="300">
|
<Motion :delay="250">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div class="w-full h-20px flex justify-between items-center">
|
<div class="w-full h-20px flex justify-between items-center">
|
||||||
|
<el-checkbox v-model="checked">记住密码</el-checkbox>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="useUserStoreHook().SET_CURRENTPAGE(4)"
|
||||||
|
>
|
||||||
|
忘记密码?
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
<el-button
|
<el-button
|
||||||
v-for="(item, index) in operates"
|
|
||||||
:key="index"
|
|
||||||
class="w-full mt-4"
|
class="w-full mt-4"
|
||||||
size="default"
|
size="default"
|
||||||
@click="onHandle(index + 1)"
|
type="primary"
|
||||||
|
:loading="loading"
|
||||||
|
@click="onLogin(ruleFormRef)"
|
||||||
>
|
>
|
||||||
{{ item.title }}
|
登录
|
||||||
</el-button>
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</Motion>
|
||||||
|
|
||||||
|
<Motion :delay="300">
|
||||||
|
<el-form-item>
|
||||||
|
<div class="w-full h-20px flex justify-between items-center">
|
||||||
|
<el-button
|
||||||
|
v-for="(item, index) in operates"
|
||||||
|
:key="index"
|
||||||
|
class="w-full mt-4"
|
||||||
|
size="default"
|
||||||
|
@click="onHandle(index + 1)"
|
||||||
|
>
|
||||||
|
{{ item.title }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</Motion>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<Motion v-if="currentPage === 0" :delay="350">
|
||||||
|
<el-form-item>
|
||||||
|
<el-divider>
|
||||||
|
<p class="text-gray-500 text-xs">第三方登录</p>
|
||||||
|
</el-divider>
|
||||||
|
<div class="w-full flex justify-evenly">
|
||||||
|
<span
|
||||||
|
v-for="(item, index) in thirdParty"
|
||||||
|
:key="index"
|
||||||
|
:title="`${item.title}登录`"
|
||||||
|
>
|
||||||
|
<IconifyIconOnline
|
||||||
|
:icon="`ri:${item.icon}-fill`"
|
||||||
|
width="20"
|
||||||
|
class="cursor-pointer text-gray-500 hover:text-blue-400"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</Motion>
|
</Motion>
|
||||||
</el-form>
|
<!-- 手机号登录 -->
|
||||||
|
<phone v-if="currentPage === 1" />
|
||||||
<Motion v-if="currentPage === 0" :delay="350">
|
<!-- 二维码登录 -->
|
||||||
<el-form-item>
|
<qrCode v-if="currentPage === 2" />
|
||||||
<el-divider>
|
<!-- 注册 -->
|
||||||
<p class="text-gray-500 text-xs">第三方登录</p>
|
<regist v-if="currentPage === 3" />
|
||||||
</el-divider>
|
<!-- 忘记密码 -->
|
||||||
<div class="w-full flex justify-evenly">
|
<update v-if="currentPage === 4" />
|
||||||
<span
|
</div>
|
||||||
v-for="(item, index) in thirdParty"
|
|
||||||
:key="index"
|
|
||||||
:title="`${item.title}登录`"
|
|
||||||
>
|
|
||||||
<IconifyIconOnline
|
|
||||||
:icon="`ri:${item.icon}-fill`"
|
|
||||||
width="20"
|
|
||||||
class="cursor-pointer text-gray-500 hover:text-blue-400"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</Motion>
|
|
||||||
<!-- 手机号登录 -->
|
|
||||||
<phone v-if="currentPage === 1" />
|
|
||||||
<!-- 二维码登录 -->
|
|
||||||
<qrCode v-if="currentPage === 2" />
|
|
||||||
<!-- 注册 -->
|
|
||||||
<regist v-if="currentPage === 3" />
|
|
||||||
<!-- 忘记密码 -->
|
|
||||||
<update v-if="currentPage === 4" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user