diff --git a/frontend/package.json b/frontend/package.json index 86336d4142..eaf0b06ab4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,6 +22,7 @@ "echarts": "^5.0.1", "element-resize-detector": "^1.2.2", "element-ui": "2.13.0", + "file-save": "^0.2.0", "file-saver": "^2.0.5", "fit2cloud-ui": "1.2.0", "html2canvas": "^1.0.0-rc.7", @@ -46,7 +47,8 @@ "vue-uuid": "2.0.2", "vuedraggable": "^2.24.3", "vuex": "3.1.0", - "webpack": "^4.46.0" + "webpack": "^4.46.0", + "xlsx": "^0.17.0" }, "devDependencies": { "@babel/core": "^7.4.0-0", @@ -67,7 +69,7 @@ "sass": "^1.32.5", "sass-loader": "^10.1.1", "script-ext-html-webpack-plugin": "2.1.3", - "script-loader": "0.7.2", + "script-loader": "^0.7.2", "serve-static": "^1.13.2", "vue-template-compiler": "2.6.10" }, diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 0c412edcd7..922fceb47c 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -9,6 +9,22 @@ :config="item" :search-count="searchCount" /> + + + + + + {{$t('chart.export_details')}} + + + + @@ -21,9 +37,10 @@ import { uuid } from 'vue-uuid' import { deepCopy } from '@/components/canvas/utils/utils' import eventBus from '@/components/canvas/utils/eventBus' import elementResizeDetectorMaker from 'element-resize-detector' +import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' export default { - components: { ComponentWrapper }, + components: { ComponentWrapper, UserViewDialog }, model: { prop: 'show', event: 'change' @@ -59,7 +76,10 @@ export default { componentDataShow: [], mainWidth: '100%', mainHeight: '100%', - searchCount: -1 + searchCount: -1, + chartDetailsVisible: false, + showChartInfo: {}, + showChartTableInfo: {} } }, computed: { @@ -118,6 +138,7 @@ export default { this.timer = setInterval(() => { this.searchCount++ }, refreshTime) + eventBus.$on('openChartDetailsDialog', this.openChartDetailsDialog) }, beforeDestroy() { clearInterval(this.timer) @@ -163,6 +184,15 @@ export default { this.componentDataShow = componentData this.$nextTick(() => (eventBus.$emit('resizing', ''))) } + }, + openChartDetailsDialog(chartInfo) { + debugger + this.showChartInfo = chartInfo.chart + this.showChartTableInfo = chartInfo.tableChart + this.chartDetailsVisible = true + }, + exportExcel() { + this.$refs['userViewDialog'].exportExcel() } } } @@ -197,4 +227,14 @@ export default { .gap_class{ padding:3px; } +.dialog-css>>>.el-dialog__title { + font-size: 14px; +} +.dialog-css >>> .el-dialog__header { + padding: 20px 20px 0; +} +.dialog-css >>> .el-dialog__body { + padding: 10px 20px 20px; +} + diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index 6a3909799e..5f5cefb06d 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -90,6 +90,23 @@ class="ref-line h-line" :style="{ top: item.position, left: item.origin, width: item.lineLength }" /> + + + + + + + {{ $t('chart.export_details') }} + + + + @@ -108,9 +125,10 @@ import eventBus from '@/components/canvas/utils/eventBus' import Grid from './Grid' import { changeStyleWithScale } from '@/components/canvas/utils/translate' import { deepCopy } from '@/components/canvas/utils/utils' +import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' export default { - components: { Shape, ContextMenu, MarkLine, Area, Grid, DeDrag }, + components: { Shape, ContextMenu, MarkLine, Area, Grid, DeDrag, UserViewDialog }, props: { isEdit: { type: Boolean, @@ -168,7 +186,10 @@ export default { hLine: [], changeIndex: 0, timeMachine: null, - outStyleOld: null + outStyleOld: null, + chartDetailsVisible: false, + showChartInfo: {}, + showChartTableInfo: {} } }, computed: { @@ -255,6 +276,7 @@ export default { // bus.$on('delete-condition', condition => { // this.deleteCondition(condition) // }) + eventBus.$on('openChartDetailsDialog', this.openChartDetailsDialog) }, created() { // this.$store.dispatch('conditions/clear') @@ -549,6 +571,15 @@ export default { destroyTimeMachine() { this.timeMachine && clearTimeout(this.timeMachine) this.timeMachine = null + }, + openChartDetailsDialog(chartInfo) { + debugger + this.showChartInfo = chartInfo.chart + this.showChartTableInfo = chartInfo.tableChart + this.chartDetailsVisible = true + }, + exportExcel() { + this.$refs['userViewDialog'].exportExcel() } } } @@ -596,5 +627,14 @@ export default { .h-line { height: 1px; } +.dialog-css>>>.el-dialog__title { + font-size: 14px; +} +.dialog-css >>> .el-dialog__header { + padding: 20px 20px 0; +} +.dialog-css >>> .el-dialog__body { + padding: 10px 20px 20px; +} diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 4d39a51293..843aff6059 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -1,5 +1,6 @@