fix(仪表板): 当前窗口打开模式下,编辑仪表板并保存,点击左上角返回按钮,无法返回到仪表板列表页

This commit is contained in:
dataeaseShu 2024-11-22 09:49:13 +08:00
parent b6584e14c2
commit e941881654
2 changed files with 18 additions and 2 deletions

View File

@ -224,7 +224,15 @@ const saveResource = () => {
ElMessage.success(t('common.save_success'))
let url = window.location.href
url = url.replace(/\?opt=create/, `?resourceId=${dvInfo.value.id}`)
window.history.replaceState(null, '', url)
if (!embeddedStore.baseUrl) {
window.history.replaceState(
{
path: url
},
'',
url
)
}
if (appData.value) {
initCanvasData(dvInfo.value.id, 'dashboard', () => {

View File

@ -166,7 +166,15 @@ const saveResource = () => {
ElMessage.success('保存成功')
let url = window.location.href
url = url.replace(/\?opt=create/, `?dvId=${dvInfo.value.id}`)
window.history.replaceState(null, '', url)
if (!embeddedStore.baseUrl) {
window.history.replaceState(
{
path: url
},
'',
url
)
}
if (appData.value) {
initCanvasData(dvInfo.value.id, 'dataV', () => {
useEmitt().emitter.emit('refresh-dataset-selector')