diff --git a/src/components/ReFlicker/index.css b/src/components/ReFlicker/index.css new file mode 100644 index 0000000..4c40af4 --- /dev/null +++ b/src/components/ReFlicker/index.css @@ -0,0 +1,39 @@ +.point { + width: var(--point-width); + height: var(--point-height); + background: var(--point-background); + position: relative; + border-radius: var(--point-border-radius); +} + +.point-flicker:after { + background: var(--point-background); +} + +.point-flicker:before, +.point-flicker:after { + content: ""; + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + border-radius: var(--point-border-radius); + animation: flicker 1.2s ease-out infinite; +} + +@keyframes flicker { + 0% { + transform: scale(0.5); + opacity: 1; + } + + 30% { + opacity: 1; + } + + 100% { + transform: scale(var(--point-scale)); + opacity: 0; + } +} diff --git a/src/components/ReFlicker/index.ts b/src/components/ReFlicker/index.ts new file mode 100644 index 0000000..b829323 --- /dev/null +++ b/src/components/ReFlicker/index.ts @@ -0,0 +1,44 @@ +import "./index.css"; +import { type Component, h, defineComponent } from "vue"; + +export interface attrsType { + width?: string; + height?: string; + borderRadius?: number | string; + background?: string; + scale?: number | string; +} + +/** + * 圆点、方形闪烁动画组件 + * @param width 可选 string 宽 + * @param height 可选 string 高 + * @param borderRadius 可选 number | string 传0为方形、传50%或者不传为圆形 + * @param background 可选 string 闪烁颜色 + * @param scale 可选 number | string 闪烁范围,默认2,值越大闪烁范围越大 + * @returns Component + */ +export function useRenderFlicker(attrs?: attrsType): Component { + return defineComponent({ + name: "ReFlicker", + render() { + return h( + "div", + { + class: "point point-flicker", + style: { + "--point-width": attrs?.width ?? "12px", + "--point-height": attrs?.height ?? "12px", + "--point-background": + attrs?.background ?? "var(--el-color-primary)", + "--point-border-radius": attrs?.borderRadius ?? "50%", + "--point-scale": attrs?.scale ?? "2" + } + }, + { + default: () => [] + } + ); + } + }); +} diff --git a/src/main.ts b/src/main.ts index d0f733c..5237cdd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,13 +4,13 @@ import { setupStore } from "@/store"; import { useI18n } from "@/plugins/i18n"; import { getPlatformConfig } from "./config"; import { MotionPlugin } from "@vueuse/motion"; -// import { useEcharts } from "@/plugins/echarts"; +import { useEcharts } from "@/plugins/echarts"; import { createApp, type Directive } from "vue"; import { useElementPlus } from "@/plugins/elementPlus"; import { injectResponsiveStorage } from "@/utils/responsive"; import Table from "@pureadmin/table"; -// import PureDescriptions from "@pureadmin/descriptions"; +import PureDescriptions from "@pureadmin/descriptions"; // 引入重置样式 import "./style/reset.scss"; @@ -56,8 +56,12 @@ getPlatformConfig(app).then(async config => { app.use(router); await router.isReady(); injectResponsiveStorage(app, config); - app.use(MotionPlugin).use(useI18n).use(useElementPlus).use(Table); - // .use(PureDescriptions) - // .use(useEcharts); + app + .use(MotionPlugin) + .use(useI18n) + .use(useElementPlus) + .use(Table) + .use(PureDescriptions) + .use(useEcharts); app.mount("#app"); }); diff --git a/src/views/login/index.vue b/src/views/login/index.vue index d00579b..1b4a9cd 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -10,6 +10,8 @@ import { useNav } from "@/layout/hooks/useNav"; import { useEventListener } from "@vueuse/core"; import type { FormInstance } from "element-plus"; import { $t, transformI18n } from "@/plugins/i18n"; +import { getConfig } from "@/config"; + // import { operates } from "./utils/enums"; import { useLayout } from "@/layout/hooks/useLayout"; import LoginPhone from "./components/LoginPhone.vue"; @@ -34,6 +36,7 @@ import Info from "@iconify-icons/ri/information-line"; import { GetCaptchaAPI } from "@/api/login"; import { getUserInfoAPI } from "@/api/login"; import { setUserInfo } from "@/utils/auth"; +const Period = getConfig("Period"); defineOptions({ name: "Login" @@ -347,12 +350,8 @@ onMounted(async () => {
+ {{ + `查询 ${item.requiredNumber} 条数据,${item.resolveNumber} 条已匹配` + }} +
+