feat(数据大屏、仪表板): div嵌入方式,资源列表增加加载完的回调事件

This commit is contained in:
wangjiahao
2025-06-19 10:22:40 +08:00
committed by 王嘉豪
parent a25d610566
commit bf8ea588c3
2 changed files with 5 additions and 4 deletions

View File

@@ -1019,12 +1019,12 @@ export function findComponentById(componentId) {
return result
}
export function onInitReady(params) {
export function onInitReady(params, eventName = 'canvas_init_ready') {
try {
console.info('Canvas initReady')
console.info('event:' + eventName)
const targetPm = {
type: 'dataease-embedded-interactive',
eventName: 'canvas_init_ready',
eventName: eventName,
args: params
}
window.parent.postMessage(targetPm, '*')

View File

@@ -48,7 +48,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import _ from 'lodash'
import DeResourceCreateOptV2 from '@/views/common/DeResourceCreateOptV2.vue'
import { useCache } from '@/hooks/web/useCache'
import { findParentIdByChildIdRecursive } from '@/utils/canvasUtils'
import { findParentIdByChildIdRecursive, onInitReady } from '@/utils/canvasUtils'
import { XpackComponent } from '@/components/plugin'
import treeSort, { treeParentWeight } from '@/utils/treeSortUtils'
import router from '@/router'
@@ -371,6 +371,7 @@ const afterTreeInit = () => {
expandedArray.value = getDefaultExpandedKeys()
returnMounted.value = false
}
onInitReady({ type: curCanvasType.value }, 'resource_tree_init_ready')
nextTick(() => {
resourceListTree.value.setCurrentKey(selectedNodeKey.value)
resourceListTree.value.filter(filterText.value)