后台管理添加体温上报
This commit is contained in:
41
frontend/src/api/report.js
Normal file
41
frontend/src/api/report.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import send_request from '../utils/send_request';
|
||||
|
||||
/**
|
||||
* 获取体温列表
|
||||
* @returns
|
||||
*/
|
||||
export function getReportList(params) {
|
||||
// 深拷贝一份,避免 删除 timestamp 时页面上的输入框也清空了
|
||||
// 但是 Date 类型的对象无法拷贝,所以还是获取深拷贝之间的
|
||||
let paramsCopy = JSON.parse(JSON.stringify(params))
|
||||
delete paramsCopy.timestamp
|
||||
if (Array.isArray(params.timestamp) && params.timestamp.length == 2) {
|
||||
paramsCopy.startTime = params.timestamp[0]?.getTime()
|
||||
paramsCopy.endTime = params.timestamp[1]?.getTime()
|
||||
}
|
||||
return send_request({
|
||||
url: '/access/report/manage/getReportList',
|
||||
method: 'GET',
|
||||
params: paramsCopy,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出体温列表
|
||||
* @returns
|
||||
*/
|
||||
export function exportReportList(params) {
|
||||
// 深拷贝一份,避免 删除 timestamp 时页面上的输入框也清空了
|
||||
// 但是 Date 类型的对象无法拷贝,所以还是获取深拷贝之间的
|
||||
let paramsCopy = JSON.parse(JSON.stringify(params))
|
||||
delete paramsCopy.timestamp
|
||||
if (Array.isArray(params.timestamp) && params.timestamp.length == 2) {
|
||||
paramsCopy.startTime = params.timestamp[0]?.getTime()
|
||||
paramsCopy.endTime = params.timestamp[1]?.getTime()
|
||||
}
|
||||
return send_request({
|
||||
url: '/access/report/manage/exportReportList',
|
||||
method: 'GET',
|
||||
params: paramsCopy,
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user