|
@@ -902,6 +902,9 @@ export default {
|
|
|
if (this.reportForm.reportDate && this.reportForm.reportDate.length > 0) {
|
|
|
p.startBelongTime = this.reportForm.reportDate[0]
|
|
|
p.endBelongTime = this.reportForm.reportDate[1]
|
|
|
+ } else {
|
|
|
+ p.startBelongTime = getNowFormatDate('yyyy-MM-dd') + ' 08:00:00'
|
|
|
+ p.endBelongTime = getNowFormatDate('yyyy-MM-dd') + ' 18:00:00'
|
|
|
}
|
|
|
|
|
|
this.getTableData(p, (res) => {
|
|
@@ -992,6 +995,9 @@ export default {
|
|
|
if (this.reportForm.reportDate && this.reportForm.reportDate.length > 0) {
|
|
|
params.startBelongTime = this.reportForm.reportDate[0]
|
|
|
params.endBelongTime = this.reportForm.reportDate[1]
|
|
|
+ } else {
|
|
|
+ params.startBelongTime = getNowFormatDate('yyyy-MM-dd') + ' 08:00:00'
|
|
|
+ params.endBelongTime = getNowFormatDate('yyyy-MM-dd') + ' 18:00:00'
|
|
|
}
|
|
|
this.getChartData(params, (res) => {
|
|
|
let result = (res instanceof Array) ? res : []
|
|
@@ -1286,21 +1292,37 @@ export default {
|
|
|
underline: false,
|
|
|
verticalAlignMode: false
|
|
|
}
|
|
|
- }
|
|
|
- // 钩子函数
|
|
|
- option.hook = {
|
|
|
- workbookCreateAfter() {
|
|
|
- option.data.forEach((data, i) => {
|
|
|
- if (data.chart && data.chart.length > 0) {
|
|
|
- data.chart.forEach((chart, j) => {
|
|
|
- console.log(chart.chart_id)
|
|
|
- let dom = document.getElementById(chart.chart_id + '_c')
|
|
|
- if (dom) dom.style.display = 'none'
|
|
|
- })
|
|
|
+ // 钩子函数
|
|
|
+ option.hook = {
|
|
|
+ workbookCreateAfter() {
|
|
|
+ option.data.forEach((data, i) => {
|
|
|
+ if (data.chart && data.chart.length > 0) {
|
|
|
+ data.chart.forEach((chart, j) => {
|
|
|
+ console.log(chart.chart_id)
|
|
|
+ let dom = document.getElementById(chart.chart_id + '_c')
|
|
|
+ if (dom) dom.style.display = 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ _this.drawAutoReportData(luckyData.tables)
|
|
|
+ luckysheet.setRangeShow('BH1')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let charts = luckyData.charts
|
|
|
+ let tables = luckyData.tables
|
|
|
+ // 钩子函数
|
|
|
+ option.hook = {
|
|
|
+ workbookCreateAfter() {
|
|
|
+ for (let i in charts) {
|
|
|
+ _this.insertEChartInfo(charts[i])
|
|
|
}
|
|
|
- })
|
|
|
- _this.drawAutoReportData(luckyData.tables)
|
|
|
- luckysheet.setRangeShow("BH1");
|
|
|
+ for (let i in tables) {
|
|
|
+ _this.insertTableInfo(tables[i])
|
|
|
+ }
|
|
|
+ _this.drawBaseInfo()
|
|
|
+ luckysheet.setRangeShow('BH1')
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
luckysheet.create(option)
|
|
@@ -1535,6 +1557,12 @@ export default {
|
|
|
}
|
|
|
const loading = showLoading(this, '保存中,请稍候···')
|
|
|
let excelData = this.chooseReportTemplate.data[0].data
|
|
|
+ let excelTable = this.chooseReportTemplate.tables
|
|
|
+ excelTable.forEach(table => {
|
|
|
+ table.field.forEach(field => {
|
|
|
+ luckysheet.setCellValue(field.r, field.c, field.name)
|
|
|
+ })
|
|
|
+ })
|
|
|
this.withDateData(excelData)
|
|
|
this.convertChart(this.chooseReportTemplate)
|
|
|
let data = {
|
|
@@ -1588,8 +1616,14 @@ export default {
|
|
|
}
|
|
|
}).then(({value}) => {
|
|
|
const loading = showLoading(this, '保存中,请稍候···')
|
|
|
- let _data = JSON.parse(this.getLuckysheetConfig())
|
|
|
let _data2 = JSON.parse(this.chooseMyReport.reportTableData)
|
|
|
+ let excelTable = _data2.tables
|
|
|
+ excelTable.forEach(table => {
|
|
|
+ table.field.forEach(field => {
|
|
|
+ luckysheet.setCellValue(field.r, field.c, field.name)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let _data = JSON.parse(this.getLuckysheetConfig())
|
|
|
let excelData = _data[0].data
|
|
|
this.withDateData(excelData)
|
|
|
_data2.data = _data
|