forked from github/dataease
Merge pull request #2875 from dataease/pr@dev@feat_export_view_log
feat(系统管理-日志管理): 增加导出视图数据日志
This commit is contained in:
commit
70f41e08bb
@ -233,6 +233,16 @@ export function exportDetails(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function innerExportDetails(data) {
|
||||||
|
return request({
|
||||||
|
url: 'panel/group/innerExportDetails',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
loading: true,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function updatePanelStatus(panelId, param) {
|
export function updatePanelStatus(panelId, param) {
|
||||||
return request({
|
return request({
|
||||||
url: '/panel/group/updatePanelStatus/' + panelId,
|
url: '/panel/group/updatePanelStatus/' + panelId,
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
:chart="mapChart || chart"
|
:chart="mapChart || chart"
|
||||||
class="chart-class"
|
class="chart-class"
|
||||||
/>
|
/>
|
||||||
<chart-component :theme-style="element.commonBackground" v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" class="chart-class" :chart="mapChart || chart" />
|
<chart-component v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" :theme-style="element.commonBackground" class="chart-class" :chart="mapChart || chart" />
|
||||||
<chart-component-g2 v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
|
<chart-component-g2 v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
|
||||||
<chart-component-s2 v-else-if="chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
|
<chart-component-s2 v-else-if="chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
|
||||||
<label-normal v-else-if="chart.type.includes('text')" :chart="chart" class="table-class" />
|
<label-normal v-else-if="chart.type.includes('text')" :chart="chart" class="table-class" />
|
||||||
@ -38,10 +38,11 @@ import ChartComponentG2 from '@/views/chart/components/ChartComponentG2'
|
|||||||
import PluginCom from '@/views/system/plugin/PluginCom'
|
import PluginCom from '@/views/system/plugin/PluginCom'
|
||||||
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
|
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
|
||||||
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
|
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
|
||||||
import { exportDetails } from '@/api/panel/panel'
|
import { exportDetails, innerExportDetails } from '@/api/panel/panel'
|
||||||
import html2canvas from 'html2canvasde'
|
import html2canvas from 'html2canvasde'
|
||||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||||
import { deepCopy, exportImg } from '@/components/canvas/utils/utils'
|
import { deepCopy, exportImg } from '@/components/canvas/utils/utils'
|
||||||
|
import { getLinkToken, getToken } from '@/utils/auth'
|
||||||
export default {
|
export default {
|
||||||
name: 'UserViewDialog',
|
name: 'UserViewDialog',
|
||||||
components: { LabelNormalText, ChartComponentS2, ChartComponentG2, DeMainContainer, DeContainer, DeAsideContainer, ChartComponent, TableNormal, LabelNormal, PluginCom },
|
components: { LabelNormalText, ChartComponentS2, ChartComponentG2, DeMainContainer, DeContainer, DeAsideContainer, ChartComponent, TableNormal, LabelNormal, PluginCom },
|
||||||
@ -187,6 +188,7 @@ export default {
|
|||||||
const excelData = JSON.parse(JSON.stringify(this.chart.data.tableRow)).map(item => excelHeaderKeys.map(i => item[i]))
|
const excelData = JSON.parse(JSON.stringify(this.chart.data.tableRow)).map(item => excelHeaderKeys.map(i => item[i]))
|
||||||
const excelName = this.chart.name
|
const excelName = this.chart.name
|
||||||
const request = {
|
const request = {
|
||||||
|
viewId: this.chart.id,
|
||||||
viewName: excelName,
|
viewName: excelName,
|
||||||
header: excelHeader,
|
header: excelHeader,
|
||||||
details: excelData,
|
details: excelData,
|
||||||
@ -195,7 +197,13 @@ export default {
|
|||||||
snapshotWidth: width,
|
snapshotWidth: width,
|
||||||
snapshotHeight: height
|
snapshotHeight: height
|
||||||
}
|
}
|
||||||
exportDetails(request).then((res) => {
|
let method = innerExportDetails
|
||||||
|
const token = this.$store.getters.token || getToken()
|
||||||
|
const linkToken = this.$store.getters.linkToken || getLinkToken()
|
||||||
|
if (!token && linkToken) {
|
||||||
|
method = exportDetails
|
||||||
|
}
|
||||||
|
method(request).then((res) => {
|
||||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.style.display = 'none'
|
link.style.display = 'none'
|
||||||
|
Loading…
Reference in New Issue
Block a user