@@ -20,7 +20,6 @@ const optInit = (viewInfo: any) => {
2020 resourceDialogShow .value = true
2121 state .viewInfo = viewInfo
2222}
23- const curOptDashboardId = ref (null )
2423const state = reactive ({
2524 dashboardList: [] as SQTreeNode [],
2625 viewInfo: null ,
@@ -127,20 +126,19 @@ const saveResourcePrepare = () => {
127126const saveResource = (params : any , commonParams : any ) => {
128127 saveDashboardResourceTarget (params , commonParams , (res : any ) => {
129128 const messageTips = t (' dashboard.add_success' )
130- curOptDashboardId .value = res ?.id
131- openMessageLoading (messageTips , ' success' , callbackExportSuc )
129+ openMessageLoading (messageTips , ' success' , res ?.id , callbackExportSuc )
132130 resetForm ()
133131 })
134132}
135133
136- const callbackExportSuc = () => {
134+ const callbackExportSuc = (curOptDashboardIdValue : any ) => {
137135 // do open dashboard
138- const url = ` #/canvas?resourceId=${curOptDashboardId . value } `
136+ const url = ` #/canvas?resourceId=${curOptDashboardIdValue } `
139137 window .open (url , ' _self' )
140138}
141139
142140// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
143- const openMessageLoading = (text : string , type = ' success' , cb : Function ) => {
141+ const openMessageLoading = (text : string , type = ' success' , dvId : any , cb : Function ) => {
144142 // success error loading
145143 const customClass = ` sq-message-${type || ' success' } sq-message-export `
146144 ElMessage ({
@@ -161,15 +159,15 @@ const openMessageLoading = (text: string, type = 'success', cb: Function) => {
161159 size: ' small' ,
162160 class: ' btn-text' ,
163161 onClick : () => {
164- cb ()
162+ cb (dvId )
165163 },
166164 },
167165 t (' dashboard.open_dashboard' )
168166 ),
169167 ]),
170168 type ,
171169 showClose: true ,
172- duration: 0 ,
170+ duration: 2000 ,
173171 customClass ,
174172 })
175173}
0 commit comments