diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue
index 98add1ebf9..867d64dd3e 100644
--- a/frontend/src/components/DeDrag/index.vue
+++ b/frontend/src/components/DeDrag/index.vue
@@ -44,7 +44,7 @@
>
-
-
+
+
-
+
-
-
+
+
@@ -157,12 +157,8 @@ export default {
this.timer = null
}
},
- showViewDetails() {
- this.$emit('showViewDetails')
- },
- componentJump() {
- window.open(url, '_blank')
- // this.$emit('showViewDetails')
+ showViewDetails(openType = 'details') {
+ this.$emit('showViewDetails', { openType: openType })
},
auxiliaryMatrixChange() {
if (this.curComponent.auxiliaryMatrix) {
diff --git a/frontend/src/components/canvas/components/Editor/EditBarView.vue b/frontend/src/components/canvas/components/Editor/EditBarView.vue
index 9d9a652572..db57a2f0ba 100644
--- a/frontend/src/components/canvas/components/Editor/EditBarView.vue
+++ b/frontend/src/components/canvas/components/Editor/EditBarView.vue
@@ -5,7 +5,7 @@
-
+
@@ -87,8 +87,8 @@ export default {
amRemoveItem() {
this.$emit('amRemoveItem')
},
- showViewDetails() {
- this.$emit('showViewDetails')
+ showViewDetails(params) {
+ this.$emit('showViewDetails', params)
},
positionCheck(position) {
return this.showPosition.includes(position)
diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue
index 6e15a7685b..19a7d214cc 100644
--- a/frontend/src/components/canvas/components/Editor/Preview.vue
+++ b/frontend/src/components/canvas/components/Editor/Preview.vue
@@ -37,22 +37,20 @@
-
-
- {{ $t('chart.export') }}
-
-
- Excel
- {{ $t('chart.image') }}
-
-
+
+ {{ $t('chart.export_img') }}
+
+
+ {{ $t('chart.export') }}Excel
+
-
+
@@ -169,6 +167,7 @@ export default {
mobileChartDetailsVisible: false,
showChartInfo: {},
showChartTableInfo: {},
+ showChartInfoType: 'details',
// 布局展示 1.pc pc端布局 2.mobile 移动端布局
terminal: 'pc'
}
@@ -189,9 +188,6 @@ export default {
return this.panelInfo.status === 'unpublished'
}
},
- showExportImgButton() {
- return this.showChartInfo.type && !this.showChartInfo.type.includes('table')
- },
canvasInfoMainStyle() {
if (this.backScreenShot) {
return {
@@ -378,6 +374,7 @@ export default {
openChartDetailsDialog(chartInfo) {
this.showChartInfo = chartInfo.chart
this.showChartTableInfo = chartInfo.tableChart
+ this.showChartInfoType = chartInfo.openType
if (this.terminal === 'pc') {
this.chartDetailsVisible = true
} else {
diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue
index c5c50d1b3e..2996cd6174 100644
--- a/frontend/src/components/canvas/components/Editor/index.vue
+++ b/frontend/src/components/canvas/components/Editor/index.vue
@@ -45,7 +45,7 @@
:linkage-active="linkageActiveCheck(item)"
:batch-opt-active="batchOptActiveCheck(item)"
@refLineParams="getRefLineParams"
- @showViewDetails="showViewDetails(index)"
+ @showViewDetails="showViewDetails($event,index)"
@resizeView="resizeView(index,item)"
@onResizeStart="startResize"
@onDragStart="onStartMove"
@@ -137,27 +137,26 @@
-
-
- {{ $t('chart.export') }}
-
-
- Excel
- {{ $t('chart.image') }}
-
-
+
+ {{ $t('chart.export_img') }}
+
+
+ {{ $t('chart.export') }}Excel
+
@@ -912,6 +911,7 @@ export default {
chartDetailsVisible: false,
showChartInfo: {},
showChartTableInfo: {},
+ showChartInfoType: 'details',
// 挤占式画布设计
baseWidth: 100,
baseHeight: 100,
@@ -1351,6 +1351,7 @@ export default {
openChartDetailsDialog(chartInfo) {
this.showChartInfo = chartInfo.chart
this.showChartTableInfo = chartInfo.tableChart
+ this.showChartInfoType = chartInfo.openType
this.chartDetailsVisible = true
},
exportExcel() {
@@ -1359,8 +1360,8 @@ export default {
exportViewImg() {
this.$refs['userViewDialog'].exportViewImg()
},
- showViewDetails(index) {
- this.$refs.wrapperChild[index].openChartDetailsDialog()
+ showViewDetails(params, index) {
+ this.$refs.wrapperChild[index].openChartDetailsDialog(params)
},
resizeView(index, item) {
diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue
index 11ea5fe040..7701922790 100644
--- a/frontend/src/components/canvas/custom-component/UserView.vue
+++ b/frontend/src/components/canvas/custom-component/UserView.vue
@@ -593,7 +593,7 @@ export default {
viewIdMatch(viewIds, viewId) {
return !viewIds || viewIds.length === 0 || viewIds.includes(viewId)
},
- openChartDetailsDialog() {
+ openChartDetailsDialog(params) {
const tableChart = deepCopy(this.chart)
tableChart.customAttr = JSON.parse(this.chart.customAttr)
tableChart.customStyle = JSON.parse(this.chart.customStyle)
@@ -604,7 +604,7 @@ export default {
tableChart.customStyle.text.show = false
tableChart.customAttr = JSON.stringify(tableChart.customAttr)
tableChart.customStyle = JSON.stringify(tableChart.customStyle)
- eventBus.$emit('openChartDetailsDialog', { chart: this.chart, tableChart: tableChart })
+ eventBus.$emit('openChartDetailsDialog', { chart: this.chart, tableChart: tableChart, openType: params.openType })
},
chartClick(param) {
if (this.drillClickDimensionList.length < this.chart.drillFields.length - 1) {
diff --git a/frontend/src/components/canvas/custom-component/UserViewDialog.vue b/frontend/src/components/canvas/custom-component/UserViewDialog.vue
index f450247a5e..2cb6895c96 100644
--- a/frontend/src/components/canvas/custom-component/UserViewDialog.vue
+++ b/frontend/src/components/canvas/custom-component/UserViewDialog.vue
@@ -1,6 +1,6 @@
-
+
-
-
+
+
@@ -43,7 +43,7 @@ import html2canvas from 'html2canvasde'
import { hexColorToRGBA } from '@/views/chart/chart/util'
import { deepCopy, exportImg } from '@/components/canvas/utils/utils'
export default {
- name: 'UserView',
+ name: 'UserViewDialog',
components: { LabelNormalText, ChartComponentS2, ChartComponentG2, DeMainContainer, DeContainer, DeAsideContainer, ChartComponent, TableNormal, LabelNormal, PluginCom },
props: {
chart: {
@@ -53,6 +53,10 @@ export default {
chartTable: {
type: Object,
default: null
+ },
+ openType: {
+ type: String,
+ default: 'details'
}
},
data() {
@@ -65,7 +69,10 @@ export default {
computed: {
showChartCanvas() {
- return this.chart.type !== 'table-normal' && this.chart.type !== 'table-info'
+ return this.openType === 'enlarge'
+ },
+ isOnlyDetails() {
+ return this.chart.type === 'table-normal' || this.chart.type === 'table-info'
},
customStyle() {
let style = {
@@ -150,13 +157,25 @@ export default {
methods: {
exportExcel() {
const _this = this
- if (this.showChartCanvas) {
- html2canvas(document.getElementById('chartCanvas')).then(canvas => {
- const snapshot = canvas.toDataURL('image/jpeg', 1) // 是图片质量
- _this.exportExcelDownload(snapshot, canvas.width, canvas.height)
- })
- } else {
+ if (this.isOnlyDetails) {
_this.exportExcelDownload()
+ } else {
+ if (this.showChartCanvas) {
+ html2canvas(document.getElementById('chartCanvas')).then(canvas => {
+ const snapshot = canvas.toDataURL('image/jpeg', 1) // 是图片质量
+ _this.exportExcelDownload(snapshot, canvas.width, canvas.height)
+ })
+ } else {
+ const dom = document.getElementById('user-view-' + this.chart.id)
+ if (dom) {
+ html2canvas(dom).then(canvas => {
+ const snapshot = canvas.toDataURL('image/jpeg', 1) // 是图片质量
+ _this.exportExcelDownload(snapshot, canvas.width, canvas.height)
+ })
+ } else {
+ _this.exportExcelDownload()
+ }
+ }
}
},
exportViewImg() {
@@ -199,15 +218,14 @@ export default {