From 3d4abe7a19edcf613c8a988c60c79e528855f168 Mon Sep 17 00:00:00 2001 From: jlzhou <12020042@qq.com> Date: Mon, 10 Feb 2025 11:11:40 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A3=9E?= =?UTF-8?q?=E7=BA=BF=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi-ui/src/components/global/WFlyingLine.vue | 135 ++++++++++++++++++++ bi-ui/src/pages/index.vue | 5 +- bi-ui/src/pages/test/FlyingLine.vue | 112 ++++++++++++++++ bi-ui/src/util/index.js | 2 + bi-ui/src/util/modules/IdGenerator.js | 26 ++++ 5 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 bi-ui/src/components/global/WFlyingLine.vue create mode 100644 bi-ui/src/pages/test/FlyingLine.vue create mode 100644 bi-ui/src/util/modules/IdGenerator.js diff --git a/bi-ui/src/components/global/WFlyingLine.vue b/bi-ui/src/components/global/WFlyingLine.vue new file mode 100644 index 0000000..2c64ce5 --- /dev/null +++ b/bi-ui/src/components/global/WFlyingLine.vue @@ -0,0 +1,135 @@ + + + \ No newline at end of file diff --git a/bi-ui/src/pages/index.vue b/bi-ui/src/pages/index.vue index 9bc4861..cfad95d 100644 --- a/bi-ui/src/pages/index.vue +++ b/bi-ui/src/pages/index.vue @@ -1,5 +1,8 @@ diff --git a/bi-ui/src/pages/test/FlyingLine.vue b/bi-ui/src/pages/test/FlyingLine.vue new file mode 100644 index 0000000..43b2e4b --- /dev/null +++ b/bi-ui/src/pages/test/FlyingLine.vue @@ -0,0 +1,112 @@ + + + \ No newline at end of file diff --git a/bi-ui/src/util/index.js b/bi-ui/src/util/index.js index 5588acc..cbf0389 100644 --- a/bi-ui/src/util/index.js +++ b/bi-ui/src/util/index.js @@ -12,6 +12,8 @@ export const util = { import * as jsencrypt from './modules/jsencrypt' export { jsencrypt } +export { IdGenerator} from './modules/IdGenerator' + export { timerBind, timerUnBind } from "./modules/timer"; export { icons } from "./modules/icons"; diff --git a/bi-ui/src/util/modules/IdGenerator.js b/bi-ui/src/util/modules/IdGenerator.js new file mode 100644 index 0000000..9bc4328 --- /dev/null +++ b/bi-ui/src/util/modules/IdGenerator.js @@ -0,0 +1,26 @@ +class IdGenerator { + static #idGenerator = new IdGenerator(); + + #count = 0; + + #countGen() { + this.#count++; + if (this.#count >= 1296) { + this.#count = 0; + } + return this.#count.toString(36).padEnd(2, "0"); + } + next() { + return ( + Date.now().toString(36) + + this.#countGen() + + Math.random().toString(36).substring(2, 10) + ); + } + + static next() { + return IdGenerator.#idGenerator.next(); + } +} + +export { IdGenerator } \ No newline at end of file