mirror of
https://github.com/dataease/dataease.git
synced 2026-06-11 15:27:02 +08:00
feat(嵌入式): 支持导出中心弹窗
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { shallowRef, defineAsyncComponent, ref, onMounted, nextTick } from 'vue'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import ExportCenterWindow from '@/pages/panel/ExportCenterWindow.vue'
|
||||
|
||||
const VisualizationEditor = defineAsyncComponent(
|
||||
() => import('@/views/data-visualization/index.vue')
|
||||
@@ -97,4 +98,5 @@ onMounted(() => {
|
||||
<template v-else>
|
||||
<component :is="currentComponent" :jsname="dataFillingPath"></component>
|
||||
</template>
|
||||
<ExportCenterWindow></ExportCenterWindow>
|
||||
</template>
|
||||
|
||||
39
core/core-frontend/src/pages/panel/ExportCenterWindow.vue
Normal file
39
core/core-frontend/src/pages/panel/ExportCenterWindow.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent, ref, nextTick } from 'vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
|
||||
const ExportExcel = defineAsyncComponent(
|
||||
() => import('@/views/visualized/data/dataset/ExportExcel.vue')
|
||||
)
|
||||
|
||||
const ExportExcelRef = ref()
|
||||
const exportCenterWindow = ref(false)
|
||||
const exportDialogShow = ref(false)
|
||||
const resetForm = () => {
|
||||
exportCenterWindow.value = false
|
||||
exportDialogShow.value = false
|
||||
}
|
||||
const showExportCenterWindow = () => {
|
||||
exportDialogShow.value = false
|
||||
exportCenterWindow.value = true
|
||||
nextTick(() => {
|
||||
ExportExcelRef.value.init()
|
||||
})
|
||||
}
|
||||
|
||||
useEmitt({
|
||||
name: 'ExportCenterWindow',
|
||||
callback: showExportCenterWindow
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="$t('data_export.export_center')"
|
||||
v-model="exportDialogShow"
|
||||
width="800px"
|
||||
:before-close="resetForm"
|
||||
>
|
||||
<ExportExcel v-if="exportCenterWindow" ref="ExportExcelRef"></ExportExcel>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -12,6 +12,7 @@ import { debounce } from 'lodash-es'
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { useLoading } from '@/hooks/web/useLoading'
|
||||
import ExportCenterWindow from '@/pages/panel/ExportCenterWindow.vue'
|
||||
|
||||
const { close } = useLoading()
|
||||
const currentComponent = shallowRef()
|
||||
@@ -109,4 +110,5 @@ useEmitt({
|
||||
<div :style="iframeStyle">
|
||||
<component :is="currentComponent" :jsname="dataFillingPath" v-if="showComponent"></component>
|
||||
</div>
|
||||
<ExportCenterWindow></ExportCenterWindow>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user