diff --git a/core/frontend/src/components/canvas/customComponent/UserView.vue b/core/frontend/src/components/canvas/customComponent/UserView.vue index 4afa2184a3..26ff35e563 100644 --- a/core/frontend/src/components/canvas/customComponent/UserView.vue +++ b/core/frontend/src/components/canvas/customComponent/UserView.vue @@ -993,14 +993,11 @@ export default { if (this.chart.type === 'map' && this.scaleCoefficientType === 'mobile') { customAttrChart.label.show = false } - const data = this.chart.data - delete this.chart.data this.chart = { ...this.chart, customAttr: JSON.stringify(customAttrChart), customStyle: JSON.stringify(customStyleChart) } - this.chart.data = data }, getData(id, cache = true, dataBroadcast = false) { if (this.requestStatus === 'waiting') { @@ -1060,12 +1057,8 @@ export default { try { // 将视图传入echart组件 if (response.success) { - const data = response.data.data - delete response.data.data this.chart = response.data this.view = response.data - this.chart.data = data - this.view.data = data this.$store.commit('setLastViewRequestInfo', { viewId: id, requestInfo: requestInfo }) this.buildInnerRefreshTimer(this.chart.refreshViewEnable, this.chart.refreshUnit, this.chart.refreshTime) this.$emit('fill-chart-2-parent', this.chart) diff --git a/core/frontend/src/components/canvas/utils/utils.js b/core/frontend/src/components/canvas/utils/utils.js index 8b4d60d147..a8c95b1b5a 100644 --- a/core/frontend/src/components/canvas/utils/utils.js +++ b/core/frontend/src/components/canvas/utils/utils.js @@ -505,6 +505,19 @@ export function exportExcelDownload(chart, snapshot, width, height, loadingWrapp }) }) } + if (chart.render === 'echarts' && chart.type === 'table-normal') { + const initTotal = fields.map(i => [2, 3].includes(i.deType) ? 0 : undefined) + initTotal[0] = '合计' + tableRow.reduce((p, n) => { + p.forEach((v, i) => { + if (!isNaN(v)) { + p[i] = v + n[excelHeaderKeys[i]] + } + }) + return p + }, initTotal) + excelData.push(initTotal) + } const request = { proxy: null, viewId: chart.id,