mirror of
https://github.com/halo-dev/halo.git
synced 2025-12-20 16:44:38 +08:00
Refactor UUID generation to shared utils.id.uuid (#7898)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script lang="ts" setup>
|
||||
import { randomUUID } from "@/utils/id";
|
||||
import { ucApiClient } from "@halo-dev/api-client";
|
||||
import {
|
||||
Dialog,
|
||||
@@ -15,9 +14,10 @@ import {
|
||||
VDropdownItem,
|
||||
VTabbar,
|
||||
} from "@halo-dev/components";
|
||||
import type {
|
||||
DashboardWidget,
|
||||
DashboardWidgetDefinition,
|
||||
import {
|
||||
utils,
|
||||
type DashboardWidget,
|
||||
type DashboardWidgetDefinition,
|
||||
} from "@halo-dev/console-shared";
|
||||
import { useQueryClient } from "@tanstack/vue-query";
|
||||
import { useEventListener } from "@vueuse/core";
|
||||
@@ -194,7 +194,7 @@ function handleAddWidget(widgetDefinition: DashboardWidgetDefinition) {
|
||||
}, 0);
|
||||
|
||||
const newWidget: DashboardWidget = {
|
||||
i: randomUUID(),
|
||||
i: utils.id.uuid(),
|
||||
x: 0,
|
||||
y: maxY + 1,
|
||||
w: widgetDefinition.defaultSize.w,
|
||||
@@ -313,7 +313,7 @@ function handleCopyFromLayout(breakpoint: string) {
|
||||
...layout.value,
|
||||
...layoutToCopy.map((widget, index) => ({
|
||||
...widget,
|
||||
i: randomUUID(),
|
||||
i: utils.id.uuid(),
|
||||
y: maxY + index + 1,
|
||||
})),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user