From 50eaa9218ac8a02bf94f2a6e4b06cad5031e71e5 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 27 May 2024 19:04:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-backend/pom.xml | 4 ++++ core/core-frontend/package.json | 8 ++++++- .../visualization/ComponentEditBar.vue | 11 +++++----- .../visualization/UserViewEnlarge.vue | 1 - core/core-frontend/src/pages/index/main.ts | 2 ++ .../visualized/data/dataset/ExportExcel.vue | 22 ++++++------------- pom.xml | 7 ++++++ .../io/dataease/utils/WhitelistUtils.java | 1 + 8 files changed, 33 insertions(+), 23 deletions(-) diff --git a/core/core-backend/pom.xml b/core/core-backend/pom.xml index 672c2dce2f..213bed5cfa 100644 --- a/core/core-backend/pom.xml +++ b/core/core-backend/pom.xml @@ -83,6 +83,10 @@ org.springframework.boot spring-boot-starter-test + + org.springframework.boot + spring-boot-starter-websocket + com.fit2cloud quartz-spring-boot-starter diff --git a/core/core-frontend/package.json b/core/core-frontend/package.json index 71aeda025a..08d27de69c 100644 --- a/core/core-frontend/package.json +++ b/core/core-frontend/package.json @@ -38,6 +38,7 @@ "lodash-es": "^4.17.21", "mathjs": "^11.6.0", "mitt": "^3.0.0", + "net": "^1.0.2", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", "pinia": "^2.0.32", @@ -63,6 +64,8 @@ "@types/element-resize-detector": "^1.1.3", "@types/jquery": "^3.5.16", "@types/lodash-es": "^4.17.6", + "@types/sockjs-client": "^1.5.4", + "@types/stompjs": "^2.3.9", "@typescript-eslint/eslint-plugin": "^5.53.0", "@typescript-eslint/parser": "^5.53.0", "@vitejs/plugin-vue": "^4.0.0", @@ -80,6 +83,8 @@ "postcss-scss": "^4.0.6", "prettier": "^2.8.4", "rimraf": "^4.1.2", + "sockjs-client": "^1.6.1", + "stompjs": "^2.3.3", "stylelint": "^15.2.0", "stylelint-config-html": "^1.1.0", "stylelint-config-recommended": "^10.0.1", @@ -96,6 +101,7 @@ "vite-plugin-style-import-secondary": "^2.0.0", "vite-plugin-stylelint": "^4.2.0", "vite-plugin-svg-icons": "^2.0.1", - "vue-tsc": "^1.0.24" + "vue-tsc": "^1.0.24", + "xss": "^1.0.14" } } diff --git a/core/core-frontend/src/components/visualization/ComponentEditBar.vue b/core/core-frontend/src/components/visualization/ComponentEditBar.vue index 5132a150fb..535d1c6d0b 100644 --- a/core/core-frontend/src/components/visualization/ComponentEditBar.vue +++ b/core/core-frontend/src/components/visualization/ComponentEditBar.vue @@ -313,12 +313,7 @@ const showBarTooltipPosition = computed(() => { } }) -const exportData = () => { - // bus.$emit('data-export-center') -} - const openMessageLoading = cb => { - console.log('bb') const iconClass = `el-icon-loading` const customClass = `de-message-loading de-message-export` ElMessage({ @@ -348,13 +343,17 @@ const openMessageLoading = cb => { }) } +const callbackExport = () => { + useEmitt().emitter.emit('data-export-center') +} + const exportAsExcel = () => { const viewDataInfo = dvMainStore.getViewDataDetails(element.value.id) const chartExtRequest = dvMainStore.getLastViewRequestInfo(element.value.id) const viewInfo = dvMainStore.getViewDetails(element.value.id) const chart = { ...viewInfo, chartExtRequest, data: viewDataInfo } exportExcelDownload(chart, () => { - openMessageLoading(exportData) + openMessageLoading(callbackExport) }) } const exportAsImage = () => { diff --git a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue index e62685c9ad..9099542da5 100644 --- a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue +++ b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue @@ -214,7 +214,6 @@ const exportData = () => { } const openMessageLoading = cb => { - console.log('bb') const iconClass = `el-icon-loading` const customClass = `de-message-loading de-message-export` ElMessage({ diff --git a/core/core-frontend/src/pages/index/main.ts b/core/core-frontend/src/pages/index/main.ts index 3d5194e584..a63f09d57b 100644 --- a/core/core-frontend/src/pages/index/main.ts +++ b/core/core-frontend/src/pages/index/main.ts @@ -14,6 +14,7 @@ import { setupCustomComponent } from '@/custom-component' import { installDirective } from '@/directive' import '@/utils/DateUtil' import '@/permission' +import WebSocketPlugin from '../../websocket' const setupAll = async () => { const app = createApp(App) installDirective(app) @@ -23,6 +24,7 @@ const setupAll = async () => { setupElementPlus(app) setupCustomComponent(app) setupElementPlusIcons(app) + app.use(WebSocketPlugin) app.mount('#app') } diff --git a/core/core-frontend/src/views/visualized/data/dataset/ExportExcel.vue b/core/core-frontend/src/views/visualized/data/dataset/ExportExcel.vue index ce32a779b6..d7c59a1224 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/ExportExcel.vue +++ b/core/core-frontend/src/views/visualized/data/dataset/ExportExcel.vue @@ -1,8 +1,9 @@