Merge pull request #13482 from dataease/pr@dev-v2_st

fix(仪表板): 当前窗口打开模式下,编辑仪表板并保存,点击左上角返回按钮,无法返回到仪表板列表页
This commit is contained in:
Junjun 2024-11-22 09:51:52 +08:00 committed by GitHub
commit 2a30d42775
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 2 deletions

View File

@ -224,7 +224,15 @@ const saveResource = () => {
ElMessage.success(t('common.save_success')) ElMessage.success(t('common.save_success'))
let url = window.location.href let url = window.location.href
url = url.replace(/\?opt=create/, `?resourceId=${dvInfo.value.id}`) 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) { if (appData.value) {
initCanvasData(dvInfo.value.id, 'dashboard', () => { initCanvasData(dvInfo.value.id, 'dashboard', () => {

View File

@ -166,7 +166,15 @@ const saveResource = () => {
ElMessage.success('保存成功') ElMessage.success('保存成功')
let url = window.location.href let url = window.location.href
url = url.replace(/\?opt=create/, `?dvId=${dvInfo.value.id}`) 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) { if (appData.value) {
initCanvasData(dvInfo.value.id, 'dataV', () => { initCanvasData(dvInfo.value.id, 'dataV', () => {
useEmitt().emitter.emit('refresh-dataset-selector') useEmitt().emitter.emit('refresh-dataset-selector')