mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 03:52:59 +08:00
refactor: 优化系统当前界面打开模式部分事件监听
This commit is contained in:
parent
d16be832f9
commit
19b1651323
@ -19,7 +19,7 @@ import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { useEmbedded } from '@/store/modules/embedded'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
import { nextTick, reactive, ref, computed, toRefs } from 'vue'
|
||||
import { nextTick, reactive, ref, computed, toRefs, onBeforeUnmount, onMounted } from 'vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
@ -198,7 +198,10 @@ const saveCanvasWithCheck = () => {
|
||||
},
|
||||
appData: appData.value
|
||||
}
|
||||
nextTick(() => {
|
||||
console.log('===test333')
|
||||
resourceAppOpt.value.init(params)
|
||||
})
|
||||
} else {
|
||||
const params = { name: dvInfo.value.name, leaf: true, id: dvInfo.value.pid }
|
||||
resourceGroupOpt.value.optInit('leaf', params, 'newLeaf', true)
|
||||
@ -304,11 +307,16 @@ const backHandler = (url: string) => {
|
||||
const multiplexingCanvasOpen = () => {
|
||||
multiplexingRef.value.dialogInit()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
eventBus.on('preview', previewInner)
|
||||
eventBus.on('save', saveCanvasWithCheck)
|
||||
eventBus.on('clearCanvas', clearCanvas)
|
||||
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
eventBus.off('preview', previewInner)
|
||||
eventBus.off('save', saveCanvasWithCheck)
|
||||
eventBus.off('clearCanvas', clearCanvas)
|
||||
})
|
||||
const openDataBoardSetting = () => {
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import icon_undo_outlined from '@/assets/svg/icon_undo_outlined.svg'
|
||||
import icon_redo_outlined from '@/assets/svg/icon_redo_outlined.svg'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { ref, nextTick, computed, toRefs } from 'vue'
|
||||
import { ref, nextTick, computed, toRefs, onBeforeUnmount, onMounted } from 'vue'
|
||||
import { useEmbedded } from '@/store/modules/embedded'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
@ -145,7 +145,10 @@ const saveCanvasWithCheck = () => {
|
||||
},
|
||||
appData: appData.value
|
||||
}
|
||||
nextTick(() => {
|
||||
console.log('===test444')
|
||||
resourceAppOpt.value.init(params)
|
||||
})
|
||||
} else {
|
||||
const params = { name: dvInfo.value.name, leaf: true, id: dvInfo.value.pid }
|
||||
resourceGroupOpt.value.optInit('leaf', params, 'newLeaf', true)
|
||||
@ -265,9 +268,17 @@ const appStore = useAppStoreWithOut()
|
||||
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
const multiplexingRef = ref(null)
|
||||
|
||||
onMounted(() => {
|
||||
eventBus.on('preview', preview)
|
||||
eventBus.on('save', saveCanvasWithCheck)
|
||||
eventBus.on('clearCanvas', clearCanvas)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
eventBus.off('preview', preview)
|
||||
eventBus.off('save', saveCanvasWithCheck)
|
||||
eventBus.off('clearCanvas', clearCanvas)
|
||||
})
|
||||
|
||||
const openOuterParamsSet = () => {
|
||||
if (componentData.value.length === 0) {
|
||||
|
@ -37,7 +37,6 @@
|
||||
:data="state.dvTree"
|
||||
:props="state.propsTree"
|
||||
@node-click="dvTreeSelect"
|
||||
:filter-method="dvTreeFilterMethod"
|
||||
:render-after-expand="false"
|
||||
filterable
|
||||
>
|
||||
@ -289,14 +288,6 @@ const init = params => {
|
||||
initData()
|
||||
}
|
||||
|
||||
const dvTreeFilterMethod = value => {
|
||||
state.dvTree = [...state.dvTree].filter(item => item.name.includes(value))
|
||||
}
|
||||
|
||||
const dsTreeFilterMethod = value => {
|
||||
state.dsTree = [...state.dsTree].filter(item => item.name.includes(value))
|
||||
}
|
||||
|
||||
const dvTreeSelect = element => {
|
||||
state.form.pid = element.id
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user