From ae798b1bd90c41a668bc5f02c412de283bb388c4 Mon Sep 17 00:00:00 2001 From: wuqun Date: Wed, 16 Nov 2022 14:19:49 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E5=91=8A=E8=AD=A6=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E8=A1=A8=E5=A4=B4=E8=8E=B7=E5=8F=96=E6=96=B9=E6=B3=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/utils/exportAlarmHeader.js | 42 ++++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/api/app/lib/utils/exportAlarmHeader.js b/api/app/lib/utils/exportAlarmHeader.js index 87f3ef0..b8cdfa1 100644 --- a/api/app/lib/utils/exportAlarmHeader.js +++ b/api/app/lib/utils/exportAlarmHeader.js @@ -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 -}; \ No newline at end of file + return { + getExportAlarmHeader + } +} \ No newline at end of file