refactor: dashboard view

This commit is contained in:
wangjiahao
2025-06-26 12:37:36 +08:00
parent bc5954007d
commit 25a895607f
2 changed files with 22 additions and 1 deletions
+21 -1
View File
@@ -67,7 +67,27 @@ export const dashboardStore = defineStore('dashboard', {
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
this.canvasViewInfo[params.id] = params
},
canvasDataInit() {},
canvasDataInit() {
this.curComponent = null
this.curComponentId = null
this.canvasStyleData = {}
this.componentData = []
this.canvasViewInfo = {}
this.dashboardInfo = {
id: null,
name: null,
pid: null,
workspaceId: null,
status: null,
dataState: null,
createName: null,
updateName: null,
createTime: null,
updateTime: null,
contentId: null,
type: null,
}
},
},
})
@@ -213,6 +213,7 @@ const addOperation = (params: any) => {
if (params.opt === 'newLeaf') {
const newCanvasUrl = '#/canvas?opt=create' + (params?.id ? `&pid=${params?.id}` : '')
window.open(newCanvasUrl, '_self')
dashboardStore.canvasDataInit()
} else {
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
resourceGroupOptRef.value?.optInit(params)