Skip to content

Commit 25a8956

Browse files
committed
refactor: dashboard view
1 parent bc59540 commit 25a8956

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

frontend/src/stores/dashboard/dashboard.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,27 @@ export const dashboardStore = defineStore('dashboard', {
6767
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
6868
this.canvasViewInfo[params.id] = params
6969
},
70-
canvasDataInit() {},
70+
canvasDataInit() {
71+
this.curComponent = null
72+
this.curComponentId = null
73+
this.canvasStyleData = {}
74+
this.componentData = []
75+
this.canvasViewInfo = {}
76+
this.dashboardInfo = {
77+
id: null,
78+
name: null,
79+
pid: null,
80+
workspaceId: null,
81+
status: null,
82+
dataState: null,
83+
createName: null,
84+
updateName: null,
85+
createTime: null,
86+
updateTime: null,
87+
contentId: null,
88+
type: null,
89+
}
90+
},
7191
},
7292
})
7393

frontend/src/views/dashboard/common/ResourceTree.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ const addOperation = (params: any) => {
213213
if (params.opt === 'newLeaf') {
214214
const newCanvasUrl = '#/canvas?opt=create' + (params?.id ? `&pid=${params?.id}` : '')
215215
window.open(newCanvasUrl, '_self')
216+
dashboardStore.canvasDataInit()
216217
} else {
217218
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
218219
resourceGroupOptRef.value?.optInit(params)

0 commit comments

Comments
 (0)