refactor(视图): 分页表格导出时支持导出全量数据

This commit is contained in:
wangjiahao
2023-02-08 18:19:45 +08:00
parent 59f7cfe257
commit c9c4ee4a61
7 changed files with 109 additions and 45 deletions

View File

@@ -770,6 +770,9 @@ export default {
if (response.success) {
this.chart = response.data
this.view = response.data
if (this.chart.type.includes('table')) {
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)
this.getDataOnly(response.data, dataBroadcast)

View File

@@ -87,9 +87,20 @@ import html2canvas from 'html2canvasde'
import { hexColorToRGBA } from '@/views/chart/chart/util'
import { deepCopy, exportImg, imgUrlTrans } from '@/components/canvas/utils/utils'
import { getLinkToken, getToken } from '@/utils/auth'
export default {
name: 'UserViewDialog',
components: { LabelNormalText, ChartComponentS2, ChartComponentG2, DeMainContainer, DeContainer, ChartComponent, TableNormal, LabelNormal, PluginCom },
components: {
LabelNormalText,
ChartComponentS2,
ChartComponentG2,
DeMainContainer,
DeContainer,
ChartComponent,
TableNormal,
LabelNormal,
PluginCom
},
props: {
chart: {
type: Object,
@@ -123,8 +134,7 @@ export default {
return this.chart.type === 'table-normal' || this.chart.type === 'table-info'
},
customStyle() {
let style = {
}
let style = {}
if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = {
@@ -186,7 +196,8 @@ export default {
'isClickComponent',
'curComponent',
'componentData',
'canvasStyleData'
'canvasStyleData',
'lastViewRequestInfo'
]),
mapChart() {
if (this.chart.type && (this.chart.type === 'map' || this.chart.type === 'buddle-map')) {
@@ -211,7 +222,7 @@ export default {
}
})
}
const result = { ...temp, ...{ DetailAreaCode: DetailAreaCode }}
const result = { ...temp, ...{ DetailAreaCode: DetailAreaCode } }
this.setLastMapChart(result)
return result
}
@@ -285,6 +296,8 @@ export default {
snapshot: snapshot,
snapshotWidth: width,
snapshotHeight: height,
componentFilterInfo: this.lastViewRequestInfo[this.chart.id],
excelHeaderKeys: excelHeaderKeys,
detailFields
}
let method = innerExportDetails
@@ -313,43 +326,49 @@ export default {
</script>
<style lang="scss" scoped>
.ms-aside-container {
height: 70vh;
min-width: 400px;
max-width: 400px;
padding: 0 0;
}
.ms-main-container {
height: 70vh;
border: 1px solid #E6E6E6;
}
.chart-class{
height: 100%;
}
.table-class{
height: 100%;
}
.canvas-class{
position: relative;
width: 100%;
height: 100%;
background-size: 100% 100% !important;
}
.abs-container {
position: absolute;
width: 100%;
margin-left: -20px;
.ms-main-container {
padding: 0px !important;
}
}
.ms-aside-container {
height: 70vh;
min-width: 400px;
max-width: 400px;
padding: 0 0;
}
.svg-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.ms-main-container {
height: 70vh;
border: 1px solid #E6E6E6;
}
.chart-class {
height: 100%;
}
.table-class {
height: 100%;
}
.canvas-class {
position: relative;
width: 100%;
height: 100%;
background-size: 100% 100% !important;
}
.abs-container {
position: absolute;
width: 100%;
margin-left: -20px;
.ms-main-container {
padding: 0px !important;
}
}
.svg-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>