Commit 0b74ee88 authored by wends's avatar wends

update 历史查询

parent 22b3f912
......@@ -73,7 +73,7 @@
<el-card class="margin-top-20">
<div slot="header" class="clearfix">
<span>详细</span>
<el-button style="float: right; padding: 3px 0" type="text">导出</el-button>
<el-button style="float: right; padding: 3px 0" type="text" @click="handleDownload">导出</el-button>
</div>
<el-table :data="tableDataPaged" border style="width: 100%">
<el-table-column type="index" label="序号" width="50" />
......@@ -257,6 +257,36 @@ export default {
await this.queryData()
return {}
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
if (j === 'time') {
return this.$moment(v[j], 'YYYY-MM-DD HH:mm:ss')
} else {
return v[j]
}
}))
},
handleDownload() {
this.downloadLoading = true
import('@/vendor/Export2Excel').then(excel => {
const tHeader = []
const filterVal = []
for (const key in this.tableDataPaged[0]) {
tHeader.push(key)
filterVal.push(key)
}
const list = this.tableData
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: this.filename,
autoWidth: this.autoWidth,
bookType: this.bookType
})
this.downloadLoading = false
})
},
getChartData(propertyCode) {
return this.tableData.map(v => {
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment