fix: types

This commit is contained in:
Fine 2024-01-29 20:14:14 +08:00
parent e8b1523842
commit a8cf5e5788

View File

@ -16,7 +16,7 @@
*/ */
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import type { LayoutConfig, DashboardItem } from "@/types/dashboard"; import type { LayoutConfig } from "@/types/dashboard";
import { ConfigFieldTypes } from "@/views/dashboard/data"; import { ConfigFieldTypes } from "@/views/dashboard/data";
export default function getDashboard(param?: { name?: string; layer: string; entity: string }, t?: string) { export default function getDashboard(param?: { name?: string; layer: string; entity: string }, t?: string) {
@ -24,7 +24,7 @@ export default function getDashboard(param?: { name?: string; layer: string; ent
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const opt = param || dashboardStore.currentDashboard; const opt = param || dashboardStore.currentDashboard;
const list = JSON.parse(sessionStorage.getItem("dashboards") || "[]"); const list = JSON.parse(sessionStorage.getItem("dashboards") || "[]");
let dashboard: Nullable<DashboardItem>; let dashboard: Recordable;
if (type === ConfigFieldTypes.NAME) { if (type === ConfigFieldTypes.NAME) {
dashboard = list.find( dashboard = list.find(
(d: { name: string; layer: string; entity: string }) => (d: { name: string; layer: string; entity: string }) =>