Merge pull request #12689 from dataease/pr@dev-v2@fix_inject-url-change

fix(数据大屏、仪表板): 修复div 嵌入仪表板设计器,编辑保存后,修改了第三方系统的路由问题
This commit is contained in:
王嘉豪 2024-10-14 15:39:54 +08:00 committed by GitHub
commit e0b2350efa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -219,7 +219,10 @@ const saveResource = () => {
canvasSave(() => {
snapshotStore.resetStyleChangeTimes()
ElMessage.success('保存成功')
window.history.pushState({}, '', `#/dashboard?resourceId=${dvInfo.value.id}`)
let url = window.location.href
url = url.replace(/\?opt=create/, `?resourceId=${dvInfo.value.id}`)
window.history.replaceState(null, '', url)
if (appData.value) {
initCanvasData(dvInfo.value.id, 'dashboard', () => {
useEmitt().emitter.emit('refresh-dataset-selector')

View File

@ -161,7 +161,9 @@ const saveResource = () => {
snapshotStore.resetStyleChangeTimes()
wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id)
ElMessage.success('保存成功')
window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`)
let url = window.location.href
url = url.replace(/\?opt=create/, `?dvId=${dvInfo.value.id}`)
window.history.replaceState(null, '', url)
if (appData.value) {
initCanvasData(dvInfo.value.id, 'dataV', () => {
useEmitt().emitter.emit('refresh-dataset-selector')