Merge pull request 'zjl' (#41) from zjl into test

Reviewed-on: #41
This commit is contained in:
朱菊兰 2023-10-12 14:43:24 +08:00
commit e40f45a79a
3 ha cambiato i file con 585 aggiunte e 143 eliminazioni

Vedi File

@ -125,7 +125,31 @@ export default {
this.$emit('submit', this.queryParams)
},
exportData() {
this.$emit('exportD')
let name
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) {//
let year = moment(timeStamp).format('YYYY')

Vedi File

@ -100,9 +100,10 @@ export default {
}
this.chartData = this.list
},
exportData() {
exportData(val) {
if (this.list.length > 0) {
var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table"))
let fileName = val.name + "同比分析.xlsx"
var wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
@ -111,7 +112,7 @@ export default {
try {
FileSaver.saveAs(
new Blob([wbout], { type: "application/octet-stream" }),
"同比分析.xlsx"
fileName
)
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);

697
yarn.lock

File diff soppresso perché troppo grande Carica Diff