Merge pull request #13676 from dataease/pr@dev-v2@fix_open-type

fix: 修复当前页面打开模式编辑数据集时再返回可能出现仪表板还原为初始状态问题
This commit is contained in:
王嘉豪 2024-11-29 11:10:28 +08:00 committed by GitHub
commit 52b0ab013a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 5 deletions

View File

@ -72,13 +72,21 @@ import {
iconFieldCalculatedQMap
} from '@/components/icon-group/field-calculated-list'
import { useCache } from '@/hooks/web/useCache'
import { canvasSave } from '@/utils/canvasUtils'
const { wsCache } = useCache('localStorage')
const embeddedStore = useEmbedded()
const snapshotStore = snapshotStoreWithOut()
const dvMainStore = dvMainStoreWithOut()
const { canvasCollapse, curComponent, componentData, editMode, mobileInPc, fullscreenFlag } =
storeToRefs(dvMainStore)
const {
canvasCollapse,
curComponent,
componentData,
editMode,
mobileInPc,
fullscreenFlag,
dvInfo
} = storeToRefs(dvMainStore)
const router = useRouter()
let componentNameEdit = ref(false)
let inputComponentName = ref('')
@ -1435,8 +1443,20 @@ const editDs = () => {
}
})
const openType = wsCache.get('open-backend') === '1' ? '_self' : '_blank'
const newWindow = window.open(routeData.href, openType)
initOpenHandler(newWindow)
//
if (openType === '_self') {
if (!dvInfo.value.id) {
ElMessage.warning(t('visualization.save_page_tips'))
return
}
canvasSave(() => {
const newWindow = window.open(routeData.href, openType)
initOpenHandler(newWindow)
})
} else {
const newWindow = window.open(routeData.href, openType)
initOpenHandler(newWindow)
}
}
const showQuotaEditCompare = item => {

View File

@ -292,7 +292,7 @@ const operation = (cmd: string, data: BusiTreeNode, nodeType: string) => {
if (cmd === 'delete') {
const msg = data.leaf ? '' : t('visualization.delete_tips')
const tips_label = data.leaf ? resourceLabel : t('visualization.folder')
ElMessageBox.confirm(t('visualization.delete_tips', tips_label), {
ElMessageBox.confirm(t('visualization.delete_warn', [tips_label]), {
confirmButtonType: 'danger',
type: 'warning',
tip: msg,