|
@@ -389,7 +389,7 @@ import {
|
|
|
saveReportTemplate,
|
|
|
updateReportTemplate
|
|
|
} from "@/api/datasource";
|
|
|
-import {handleTree, showAlertWin, showLoading, traverseNode, traverseVisible} from "@/utils/cqcy";
|
|
|
+import {getLuckysheetConfig, handleTree, showAlertWin, showLoading, traverseNode, traverseVisible} from "@/utils/cqcy";
|
|
|
import {getDictByKey} from "@/api/basic";
|
|
|
import {exportExcel} from "@/utils/export";
|
|
|
import {insertLuckysheetEChart} from "@/utils/luckysheettool";
|
|
@@ -457,7 +457,7 @@ export default {
|
|
|
templateName: '',
|
|
|
templateId: '',
|
|
|
templateVersion: '',
|
|
|
- reportTemplateItem: 'REPORT_TEMPLATE_ITEM',
|
|
|
+ reportTemplateItem: this.$store.getters.sessionName.REPORT_TEMPLATE_ITEM,
|
|
|
reportInterval: null,
|
|
|
toolChart: [],
|
|
|
toolTable: [],
|
|
@@ -698,7 +698,7 @@ export default {
|
|
|
}).then(({ value }) => {
|
|
|
const loading = showLoading(this, '保存中,请稍候···')
|
|
|
let option = JSON.parse(JSON.stringify(this.luckysheetOption))
|
|
|
- let _data = JSON.parse(this.getLuckysheetConfig())
|
|
|
+ let _data = JSON.parse(getLuckysheetConfig())
|
|
|
let excelData = _data[0].data
|
|
|
this.withDateData(excelData)
|
|
|
this.spliceToolTable()
|
|
@@ -844,28 +844,6 @@ export default {
|
|
|
loading.close()
|
|
|
})
|
|
|
},
|
|
|
- /** 保存数据格式转换 */
|
|
|
- getLuckysheetConfig() {
|
|
|
- let ls = luckysheet.getLuckysheetfile()
|
|
|
- ls.forEach((item, index) => {
|
|
|
- if(item.chart) {
|
|
|
- item.chart.forEach((chart, i) => {
|
|
|
- ls[index].chart[i] = {
|
|
|
- ...ls[index].chart[i],
|
|
|
- chartOptions: {...chartmix.default.getChartJson(chart.chart_id)}
|
|
|
- }
|
|
|
- let div = document.getElementById(chart.chart_id + '_c');
|
|
|
- if(div.style) {
|
|
|
- ls[index].chart[i].left = parseInt(div.style.left)
|
|
|
- ls[index].chart[i].top = parseInt(div.style.top)
|
|
|
- ls[index].chart[i].width = parseInt(div.style.width)
|
|
|
- ls[index].chart[i].height = parseInt(div.style.height)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- return JSON.stringify(ls)
|
|
|
- },
|
|
|
/** 生成唯一 ID 字符串 */
|
|
|
generateRandomKey(prefix) {
|
|
|
if (prefix == null) {
|
|
@@ -1546,7 +1524,7 @@ export default {
|
|
|
let result = {
|
|
|
'charts': _this.toolChart,
|
|
|
'tables': _this.toolTable,
|
|
|
- 'data': JSON.parse(_this.getLuckysheetConfig())
|
|
|
+ 'data': JSON.parse(getLuckysheetConfig())
|
|
|
}
|
|
|
localStorage.setItem(_this.reportTemplateItem, JSON.stringify(result))
|
|
|
console.log(new Date().getTime(), 'auto save report template success.')
|