From 67d30ed976ab774b5f6b9ff010217277ea463e40 Mon Sep 17 00:00:00 2001 From: bunny <1319900154@qq.com> Date: Tue, 29 Apr 2025 17:50:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/App.vue | 8 +- .../{CountTo => ReCountTo}/index.ts | 0 .../src/normal/index.tsx | 2 +- .../src/normal/props.ts | 0 .../src/rebound/index.tsx | 2 +- .../src/rebound/props.ts | 0 .../src/rebound/rebound.css | 8 +- src/components/ReCropper/src/index.tsx | 123 +++++++++++++----- .../index.ts | 0 .../src/index.vue | 27 ++-- .../lay-notice/components/NoticeList.vue | 2 +- .../components/lay-sidebar/NavHorizontal.vue | 33 ++--- .../account-settings/components/profile.vue | 2 +- src/views/system/admin-user/utils/hooks.tsx | 2 +- src/views/welcome/index.vue | 2 +- 16 files changed, 126 insertions(+), 87 deletions(-) rename src/components/{CountTo => ReCountTo}/index.ts (100%) rename src/components/{CountTo => ReCountTo}/src/normal/index.tsx (98%) rename src/components/{CountTo => ReCountTo}/src/normal/props.ts (100%) rename src/components/{CountTo => ReCountTo}/src/rebound/index.tsx (94%) rename src/components/{CountTo => ReCountTo}/src/rebound/props.ts (100%) rename src/components/{CountTo => ReCountTo}/src/rebound/rebound.css (100%) rename src/components/{CropperPreview => ReCropperPreview}/index.ts (100%) rename src/components/{CropperPreview => ReCropperPreview}/src/index.vue (61%) diff --git a/package.json b/package.json index b1dda31..8ae223f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bunny-auth-admin", - "version": "3.0.0", + "version": "4.0.0", "private": true, "type": "module", "license": "MIT", diff --git a/src/App.vue b/src/App.vue index d346dc1..b4583dc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -21,9 +21,7 @@ const i18nStore = userI18nStore(); const i18n = useI18n(); const { $storage } = useNav(); -/** - * * 设置多语言内容 - */ +/* 设置多语言内容 */ const setI18n = async () => { await i18nStore.loadI18nMap(); const languageData = JSON.parse(localStorage.getItem('i18nStore') as any); @@ -44,9 +42,7 @@ const setI18n = async () => { i18n.mergeLocaleMessage(locale, languageData.i18n[locale]); }; -/** - * * 当前语言类别 - */ +/* 当前语言类别 */ const currentLocale = computed(() => { const languageData = JSON.parse(localStorage.getItem('i18nStore') as any); const local = languageData ? languageData.i18n.local : {}; diff --git a/src/components/CountTo/index.ts b/src/components/ReCountTo/index.ts similarity index 100% rename from src/components/CountTo/index.ts rename to src/components/ReCountTo/index.ts diff --git a/src/components/CountTo/src/normal/index.tsx b/src/components/ReCountTo/src/normal/index.tsx similarity index 98% rename from src/components/CountTo/src/normal/index.tsx rename to src/components/ReCountTo/src/normal/index.tsx index 8aaad90..93a0fb6 100644 --- a/src/components/CountTo/src/normal/index.tsx +++ b/src/components/ReCountTo/src/normal/index.tsx @@ -1,4 +1,4 @@ -import { computed, defineComponent, onMounted, reactive, unref, watch } from 'vue'; +import { watch, unref, computed, reactive, onMounted, defineComponent } from 'vue'; import { countToProps } from './props'; import { isNumber } from '@pureadmin/utils'; diff --git a/src/components/CountTo/src/normal/props.ts b/src/components/ReCountTo/src/normal/props.ts similarity index 100% rename from src/components/CountTo/src/normal/props.ts rename to src/components/ReCountTo/src/normal/props.ts diff --git a/src/components/CountTo/src/rebound/index.tsx b/src/components/ReCountTo/src/rebound/index.tsx similarity index 94% rename from src/components/CountTo/src/rebound/index.tsx rename to src/components/ReCountTo/src/rebound/index.tsx index 5d64112..51066a3 100644 --- a/src/components/CountTo/src/rebound/index.tsx +++ b/src/components/ReCountTo/src/rebound/index.tsx @@ -1,5 +1,5 @@ import './rebound.css'; -import { defineComponent, onBeforeMount, onBeforeUnmount, ref, unref } from 'vue'; +import { ref, unref, onBeforeMount, defineComponent, onBeforeUnmount } from 'vue'; import { reboundProps } from './props'; export default defineComponent({ diff --git a/src/components/CountTo/src/rebound/props.ts b/src/components/ReCountTo/src/rebound/props.ts similarity index 100% rename from src/components/CountTo/src/rebound/props.ts rename to src/components/ReCountTo/src/rebound/props.ts diff --git a/src/components/CountTo/src/rebound/rebound.css b/src/components/ReCountTo/src/rebound/rebound.css similarity index 100% rename from src/components/CountTo/src/rebound/rebound.css rename to src/components/ReCountTo/src/rebound/rebound.css index 48ca1e6..9fc5932 100644 --- a/src/components/CountTo/src/rebound/rebound.css +++ b/src/components/ReCountTo/src/rebound/rebound.css @@ -1,12 +1,12 @@ .scroll-num { - animation: enhance-bounce-in-down 1s calc(var(--delay) * 1s) forwards; + width: var(--width, 20px); + height: var(--height, calc(var(--width, 20px) * 1.8)); color: var(--color, #333); font-size: var(--height, calc(var(--width, 20px) * 1.1)); - height: var(--height, calc(var(--width, 20px) * 1.8)); line-height: var(--height, calc(var(--width, 20px) * 1.8)); - overflow: hidden; text-align: center; - width: var(--width, 20px); + overflow: hidden; + animation: enhance-bounce-in-down 1s calc(var(--delay) * 1s) forwards; } ul { diff --git a/src/components/ReCropper/src/index.tsx b/src/components/ReCropper/src/index.tsx index a8e368f..35c111a 100644 --- a/src/components/ReCropper/src/index.tsx +++ b/src/components/ReCropper/src/index.tsx @@ -2,26 +2,26 @@ import './circled.css'; import Cropper from 'cropperjs'; import { ElUpload } from 'element-plus'; import type { CSSProperties } from 'vue'; -import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, unref } from 'vue'; import { useEventListener } from '@vueuse/core'; import { longpress } from '@/directives/longpress'; -import { directive as tippy, useTippy } from 'vue-tippy'; -import { debounce, delay, downloadByBase64, isArray, useResizeObserver } from '@pureadmin/utils'; +import { useTippy, directive as tippy } from 'vue-tippy'; +import { type PropType, ref, unref, computed, onMounted, onUnmounted, defineComponent } from 'vue'; +import { delay, debounce, isArray, downloadByBase64, useResizeObserver } from '@pureadmin/utils'; import { - ArrowDown, - ArrowH, - ArrowLeft, - ArrowRight, - ArrowUp, - ArrowV, - ChangeIcon, - DownloadIcon, Reload, + Upload, + ArrowH, + ArrowV, + ArrowUp, + ArrowDown, + ArrowLeft, + ChangeIcon, + ArrowRight, RotateLeft, + SearchPlus, RotateRight, SearchMinus, - SearchPlus, - Upload, + DownloadIcon, } from './svg'; type Options = Cropper.Options; @@ -101,7 +101,7 @@ export default defineComponent({ }); const iconClass = computed(() => { - return ['p-[6px]', 'h-[30px]', 'w-[30px]', 'outline-none', 'rounded-[4px]', 'cursor-pointer', 'hover:bg-[rgba(0,0,0,0.06)]']; + return ['p-[6px]', 'h-[30px]', 'w-[30px]', 'outline-hidden', 'rounded-[4px]', 'cursor-pointer', 'hover:bg-[rgba(0,0,0,0.06)]']; }); const getWrapperStyle = computed((): CSSProperties => { @@ -124,7 +124,7 @@ export default defineComponent({ async function init() { const imgEl = unref(imgElRef); if (!imgEl) return; - const result: any = new Cropper(imgEl, { + cropper.value = new Cropper(imgEl, { ...defaultOptions, ready: () => { isReady.value = true; @@ -142,11 +142,6 @@ export default defineComponent({ }, ...props.options, }); - - // 如果图片不存在直接将加载变为加载完成 - if (!result.ready) emit('readied', cropper.value); - - cropper.value = result; } function realTimeCroppered() { @@ -226,30 +221,55 @@ export default defineComponent({ return () => (