1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

进出日志后台查询;小程序端进门;导出表格时日期转换

This commit is contained in:
2023-04-16 16:56:56 +08:00
parent c91b045430
commit 62ed92029c
19 changed files with 567 additions and 32 deletions

View File

@@ -487,7 +487,7 @@ const handleExport = async () => {
// 如果选择仅导出满肚条件的数据,那么这里就填上查询参数
if (exportConfig.value.withFilter) {
params = JSON.parse(JSON.stringify(query))
// 去除分页参数
// 去除分页参数
delete params["pageIndex"]
delete params["pageSize"]
}
@@ -514,6 +514,17 @@ const handleExport = async () => {
}
console.log("dataList", dataList)
// 日期转换
let timeField = tableFields.value.filter((field: any) => field.type == "time")
console.log("timeField", timeField)
for (let field of timeField) {
console.log("field.prop", field.prop)
dataList = dataList.map((row: any) => {
row[field.prop] = new Date(row[field.prop] + 8 * 3600 * 1000).toISOString().replace('T', ' ').substring(0, 19)
return row
})
}
// 所有列的 field
let fieldNameList = exportFields.map((f: any) => f.field)
fieldNameList.unshift(idFieldName)