forked from github/dataease
Merge pull request #9947 from dataease/pr@dev-v2_export_data
feat: 新增导出中心功能
This commit is contained in:
commit
1055c7da17
@ -203,14 +203,13 @@ const downloadViewDetails = () => {
|
|||||||
}
|
}
|
||||||
exportLoading.value = true
|
exportLoading.value = true
|
||||||
exportExcelDownload(chart, () => {
|
exportExcelDownload(chart, () => {
|
||||||
console.log('aa')
|
|
||||||
openMessageLoading(exportData)
|
openMessageLoading(exportData)
|
||||||
exportLoading.value = false
|
exportLoading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportData = () => {
|
const exportData = () => {
|
||||||
// bus.$emit('data-export-center')
|
useEmitt().emitter.emit('data-export-center')
|
||||||
}
|
}
|
||||||
|
|
||||||
const openMessageLoading = cb => {
|
const openMessageLoading = cb => {
|
||||||
|
@ -51,9 +51,6 @@ const handleClose = () => {
|
|||||||
drawer.value = false
|
drawer.value = false
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
|
||||||
eventBus.on('task-export-topic-call', taskExportTopicCall)
|
|
||||||
})
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
@ -156,6 +153,7 @@ const taskExportTopicCall = task => {
|
|||||||
'success',
|
'success',
|
||||||
callbackExport
|
callbackExport
|
||||||
)
|
)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if (JSON.parse(task).exportStatus === 'FAILED') {
|
if (JSON.parse(task).exportStatus === 'FAILED') {
|
||||||
openMessageLoading(JSON.parse(task).exportFromName + ' 导出失败,前往', 'error', callbackExport)
|
openMessageLoading(JSON.parse(task).exportFromName + ' 导出失败,前往', 'error', callbackExport)
|
||||||
@ -329,6 +327,8 @@ const delAll = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eventBus.on('task-export-topic-call', taskExportTopicCall)
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
init
|
init
|
||||||
})
|
})
|
||||||
|
@ -23,10 +23,17 @@ export default {
|
|||||||
if (!isLoginStatus()) {
|
if (!isLoginStatus()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (stompClient !== null && stompClient != undefined && stompClient.connected) {
|
if (stompClient && stompClient.connected) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const socket = new SockJS(basePath + '/websocket?userId=' + wsCache.get('user.uid'))
|
let prefix = '/'
|
||||||
|
if (window.DataEaseBi?.baseUrl) {
|
||||||
|
prefix = window.DataEaseBi.baseUrl
|
||||||
|
} else {
|
||||||
|
const href = window.location.href
|
||||||
|
prefix = href.substring(0, href.indexOf('#'))
|
||||||
|
}
|
||||||
|
const socket = new SockJS(prefix + 'websocket?userId=' + wsCache.get('user.uid'))
|
||||||
stompClient = Stomp.over(socket)
|
stompClient = Stomp.over(socket)
|
||||||
const heads = {
|
const heads = {
|
||||||
userId: wsCache.get('user.uid')
|
userId: wsCache.get('user.uid')
|
||||||
@ -47,7 +54,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function disconnect() {
|
function disconnect() {
|
||||||
if (stompClient !== null && stompClient != undefined && !stompClient.connected) {
|
if (stompClient && stompClient.connected) {
|
||||||
stompClient.disconnect(
|
stompClient.disconnect(
|
||||||
function () {
|
function () {
|
||||||
console.log('断开连接')
|
console.log('断开连接')
|
||||||
@ -66,7 +73,7 @@ export default {
|
|||||||
disconnect()
|
disconnect()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (stompClient !== null && stompClient != undefined && !stompClient.connected) {
|
if (!stompClient || !stompClient.connected) {
|
||||||
connection()
|
connection()
|
||||||
}
|
}
|
||||||
}, 5000)
|
}, 5000)
|
||||||
|
Loading…
Reference in New Issue
Block a user