|
|
@ -242,26 +242,28 @@ let header_app = [{ |
|
|
|
title: "确认/恢复时间", |
|
|
|
key: "confirmTime", |
|
|
|
}]; |
|
|
|
async function getExportAlarmHeader(ctx, type) { |
|
|
|
try { |
|
|
|
let headerMap = { |
|
|
|
"1": headerZD,//数据中断
|
|
|
|
"2": headerYC,//数据异常
|
|
|
|
"3": headerMZ,//策略命中
|
|
|
|
"4,5": headerSB,//设备异常
|
|
|
|
video: header_video, |
|
|
|
app: header_app, |
|
|
|
} |
|
|
|
return headerMap[type] || [] |
|
|
|
} catch (error) { |
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|
|
|
ctx.status = 400; |
|
|
|
ctx.body = { |
|
|
|
message: typeof error == 'string' ? error : undefined |
|
|
|
module.exports = function (app, opts) { |
|
|
|
async function getExportAlarmHeader(ctx, type) { |
|
|
|
try { |
|
|
|
let headerMap = { |
|
|
|
"1": headerZD,//数据中断
|
|
|
|
"2": headerYC,//数据异常
|
|
|
|
"3": headerMZ,//策略命中
|
|
|
|
"4,5": headerSB,//设备异常
|
|
|
|
video: header_video, |
|
|
|
app: header_app, |
|
|
|
} |
|
|
|
return headerMap[type] || [] |
|
|
|
} catch (error) { |
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|
|
|
ctx.status = 400; |
|
|
|
ctx.body = { |
|
|
|
message: typeof error == 'string' ? error : undefined |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
getExportAlarmHeader |
|
|
|
}; |
|
|
|
return { |
|
|
|
getExportAlarmHeader |
|
|
|
} |
|
|
|
} |