You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
3 years ago
|
'use strict';
|
||
|
|
||
|
const { simpleExcelDown } = require('../../../../utils/xlsxDownload');
|
||
|
|
||
|
async function dataExport (ctx) {
|
||
|
try {
|
||
|
// const models = ctx.fs.dc.models;
|
||
|
// const { userId } = ctx.fs.api
|
||
|
// const { ids } = ctx.query;
|
||
|
|
||
|
// const exportData = await models.BusCar.destroy({
|
||
|
// where: {
|
||
|
// id: { $in: ids.split(',') }
|
||
|
// }
|
||
|
// })
|
||
|
|
||
|
// const fileName = `摄像头信息列表_${userId}_${moment().format('YYYYMMDDHHmmss')}` + '.csv'
|
||
|
// const filePath = await simpleExcelDown({ data: exportData, header, fileName: fileName })
|
||
|
// const fileData = fs.readFileSync(filePath);
|
||
|
|
||
|
// ctx.status = 200;
|
||
|
// ctx.set('Content-Type', 'application/x-xls');
|
||
|
// ctx.set('Content-disposition', 'attachment; filename=' + encodeURI(fileName));
|
||
|
// ctx.body = fileData;
|
||
|
} catch (error) {
|
||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
|
||
|
ctx.status = 400;
|
||
|
ctx.body = {
|
||
|
message: typeof error == 'string' ? error : undefined
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
dataExport
|
||
|
};
|