function getList() {
listWarn(queryParams).then(res => {
let list = res.rows || [];
tables.value = list;
console.log(tables.value, 'tables.value');
total.value = res.total;
for (let i = 0; i < res.rows.length; i++) {
// 转换开始时间数据格式
if (tables.value[i].startTime) {
var customTime = tables.value[i].startTime;
tables.value[i].startTime = dateFunction(customTime); //2021-02-01 00:00:00
}
// 转换结束时间数据格式
if (tables.value[i].endTime) {
var customTimeLast = tables.value[i].endTime
tables.value[i].endTime = dateFunction(customTimeLast); //2021-02-01 00:00:00
}
var customStatus = tables.value[i].processStatus
tables.value[i].processStatus = statusFunction(customStatus)
}
});
}
//处理日期数据格式
function dateFunction(time) {
var zoneDate = new Date(time).toJSON();
var date = new Date(+new Date(zoneDate) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
return date;
}