forked from github/dataease
Merge pull request #12067 from dataease/pr@dev-v2@refactor_events
refactor(数据大屏、仪表板): 删除组件分享事件逻辑
This commit is contained in:
commit
f754a2c3da
@ -268,8 +268,6 @@ const onWrapperClick = e => {
|
|||||||
useEmitt().emitter.emit('componentRefresh')
|
useEmitt().emitter.emit('componentRefresh')
|
||||||
} else if (config.value.events.type === 'fullScreen') {
|
} else if (config.value.events.type === 'fullScreen') {
|
||||||
useEmitt().emitter.emit('canvasFullscreen')
|
useEmitt().emitter.emit('canvasFullscreen')
|
||||||
} else if (config.value.events.type === 'share') {
|
|
||||||
useEmitt().emitter.emit('shareComponent')
|
|
||||||
} else if (config.value.events.type === 'download') {
|
} else if (config.value.events.type === 'download') {
|
||||||
useEmitt().emitter.emit('canvasDownload')
|
useEmitt().emitter.emit('canvasDownload')
|
||||||
}
|
}
|
||||||
|
@ -18,14 +18,12 @@ import CanvasFilterBtn from '@/custom-component/canvas-filter-btn/Component.vue'
|
|||||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||||
import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
|
import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
|
||||||
import DeFullscreen from '@/components/visualization/common/DeFullscreen.vue'
|
import DeFullscreen from '@/components/visualization/common/DeFullscreen.vue'
|
||||||
import ShareHandler from '@/views/share/share/ShareHandler.vue'
|
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { pcMatrixCount, curComponent, mobileInPc, canvasState } = storeToRefs(dvMainStore)
|
const { pcMatrixCount, curComponent, mobileInPc, canvasState } = storeToRefs(dvMainStore)
|
||||||
const openHandler = ref(null)
|
const openHandler = ref(null)
|
||||||
const customDatasetParamsRef = ref(null)
|
const customDatasetParamsRef = ref(null)
|
||||||
const emits = defineEmits(['onResetLayout'])
|
const emits = defineEmits(['onResetLayout'])
|
||||||
const fullScreeRef = ref(null)
|
const fullScreeRef = ref(null)
|
||||||
const shareComponent = ref(null)
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
canvasStyleData: {
|
canvasStyleData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -201,15 +199,6 @@ useEmitt({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
useEmitt({
|
|
||||||
name: 'shareComponent',
|
|
||||||
callback: function () {
|
|
||||||
if (isMainCanvas(canvasId.value)) {
|
|
||||||
shareComponent.value.execute()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const resetLayout = () => {
|
const resetLayout = () => {
|
||||||
if (downloadStatus.value) {
|
if (downloadStatus.value) {
|
||||||
return
|
return
|
||||||
@ -454,12 +443,6 @@ defineExpose({
|
|||||||
<de-fullscreen ref="fullScreeRef"></de-fullscreen>
|
<de-fullscreen ref="fullScreeRef"></de-fullscreen>
|
||||||
<dataset-params-component ref="customDatasetParamsRef"></dataset-params-component>
|
<dataset-params-component ref="customDatasetParamsRef"></dataset-params-component>
|
||||||
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
|
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
|
||||||
<ShareHandler
|
|
||||||
ref="shareComponent"
|
|
||||||
:resource-id="dvInfo.id"
|
|
||||||
:resource-type="dvInfo.type"
|
|
||||||
:weight="dvInfo.weight"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
@ -22,7 +22,7 @@ const isDashboard = dvMainStore.dvInfo.type === 'dashboard'
|
|||||||
|
|
||||||
const curSupportEvents = computed(() => {
|
const curSupportEvents = computed(() => {
|
||||||
if (isDashboard) {
|
if (isDashboard) {
|
||||||
return ['jump', 'refreshDataV', 'fullScreen', 'share', 'download']
|
return ['jump', 'refreshDataV', 'fullScreen', 'download']
|
||||||
} else {
|
} else {
|
||||||
return ['jump', 'showHidden', 'refreshDataV', 'fullScreen', 'download']
|
return ['jump', 'showHidden', 'refreshDataV', 'fullScreen', 'download']
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user