fix(仪表板): 切换导航主菜单时,闪现其他的空状态图片

This commit is contained in:
dataeaseShu 2024-02-01 17:16:02 +08:00
parent 8a7ce99b9d
commit 1cd09f86ec
2 changed files with 9 additions and 3 deletions

View File

@ -41,6 +41,7 @@ const defaultProps = {
children: 'children',
label: 'name'
}
const mounted = ref(false)
const rootManage = ref(false)
const anyManage = ref(false)
const { curCanvasType, showPosition } = toRefs(props)
@ -219,6 +220,7 @@ function flatTree(tree: BusiTreeNode[]) {
}
const afterTreeInit = () => {
mounted.value = true
if (selectedNodeKey.value && returnMounted.value) {
expandedArray.value = getDefaultExpandedKeys()
returnMounted.value = false
@ -371,7 +373,8 @@ onMounted(() => {
defineExpose({
rootManage,
hasData,
createNewObject
createNewObject,
mounted
})
</script>

View File

@ -52,6 +52,9 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
const rootManage = computed(() => {
return resourceTreeRef.value?.rootManage
})
const mounted = computed(() => {
return resourceTreeRef.value?.mounted
})
function createNew() {
resourceTreeRef.value?.createNewObject()
@ -188,10 +191,10 @@ defineExpose({
></de-preview>
</div>
</template>
<template v-else-if="hasTreeData">
<template v-else-if="hasTreeData && mounted">
<empty-background description="请在左侧选择仪表板" img-type="select" />
</template>
<template v-else>
<template v-else-if="mounted">
<empty-background description="暂无仪表板" img-type="none">
<el-button v-if="rootManage && !isDataEaseBi" @click="createNew" type="primary">
<template #icon>