mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
Merge pull request #13676 from dataease/pr@dev-v2@fix_open-type
fix: 修复当前页面打开模式编辑数据集时再返回可能出现仪表板还原为初始状态问题
This commit is contained in:
commit
52b0ab013a
@ -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 => {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user