Skip to content

Commit ef549c7

Browse files
authored
fix: Anchor point positioning error of the discriminator node (#3710)
1 parent bc6a5a8 commit ef549c7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"mermaid": "^10.9.0",
3939
"mitt": "^3.0.0",
4040
"moment": "^2.30.1",
41+
"nanoid": "^5.1.5",
4142
"npm": "^10.2.4",
4243
"nprogress": "^0.2.0",
4344
"pinia": "^2.1.6",

ui/src/utils/utils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { MsgError } from '@/utils/message'
2-
2+
import { nanoid } from 'nanoid'
33
export function toThousands(num: any) {
44
return num?.toString().replace(/\d+/, function (n: any) {
55
return n.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
@@ -25,7 +25,7 @@ export function filesize(size: number) {
2525
随机id
2626
*/
2727
export const randomId = function () {
28-
return Math.floor(Math.random() * 10000) + ''
28+
return nanoid()
2929
}
3030

3131
/*
@@ -48,7 +48,9 @@ const typeList: any = {
4848
export function getImgUrl(name: string) {
4949
const list = Object.values(typeList).flat()
5050

51-
const type = list.includes(fileType(name).toLowerCase()) ? fileType(name).toLowerCase() : 'unknown'
51+
const type = list.includes(fileType(name).toLowerCase())
52+
? fileType(name).toLowerCase()
53+
: 'unknown'
5254
return new URL(`../assets/fileType/${type}-icon.svg`, import.meta.url).href
5355
}
5456
// 是否是白名单后缀

0 commit comments

Comments
 (0)