Compare commits
No commits in common. "e40f45a79af3e63edfd0e21cfc51887d159d1963" and "03c573d5b23829b29583379798eb648d101df8f7" have entirely different histories.
e40f45a79a
...
03c573d5b2
@ -125,31 +125,7 @@ export default {
|
|||||||
this.$emit('submit', this.queryParams)
|
this.$emit('submit', this.queryParams)
|
||||||
},
|
},
|
||||||
exportData() {
|
exportData() {
|
||||||
let name
|
this.$emit('exportD')
|
||||||
if (this.queryParams.objId) {
|
|
||||||
name = this.getObjName(this.objList, this.queryParams.objId)
|
|
||||||
} else {
|
|
||||||
this.$modal.msgWarning("对象不能为空")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
this.$emit('exportD', {name: name})
|
|
||||||
},
|
|
||||||
// 递归取对象name
|
|
||||||
getObjName(list, id) {
|
|
||||||
let _this = this
|
|
||||||
for (let i = 0; i < list.length; i++) {
|
|
||||||
let a = list[i]
|
|
||||||
if (a.id === id) {
|
|
||||||
return a.name
|
|
||||||
} else {
|
|
||||||
if (a.children && a.children.length > 0) {
|
|
||||||
let res = _this.getObjName(a.children, id)
|
|
||||||
if (res) {
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
transformTime(timeStamp) {// 本月最后一天
|
transformTime(timeStamp) {// 本月最后一天
|
||||||
let year = moment(timeStamp).format('YYYY')
|
let year = moment(timeStamp).format('YYYY')
|
||||||
|
@ -100,10 +100,9 @@ export default {
|
|||||||
}
|
}
|
||||||
this.chartData = this.list
|
this.chartData = this.list
|
||||||
},
|
},
|
||||||
exportData(val) {
|
exportData() {
|
||||||
if (this.list.length > 0) {
|
if (this.list.length > 0) {
|
||||||
var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table"))
|
var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table"))
|
||||||
let fileName = val.name + "同比分析.xlsx"
|
|
||||||
var wbout = XLSX.write(wb, {
|
var wbout = XLSX.write(wb, {
|
||||||
bookType: "xlsx",
|
bookType: "xlsx",
|
||||||
bookSST: true,
|
bookSST: true,
|
||||||
@ -112,7 +111,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
FileSaver.saveAs(
|
FileSaver.saveAs(
|
||||||
new Blob([wbout], { type: "application/octet-stream" }),
|
new Blob([wbout], { type: "application/octet-stream" }),
|
||||||
fileName
|
"同比分析.xlsx"
|
||||||
)
|
)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (typeof console !== "undefined") console.log(e, wbout);
|
if (typeof console !== "undefined") console.log(e, wbout);
|
||||||
|
Loading…
Reference in New Issue
Block a user