(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-e9160bc6"],{
/***/"07ed":
/***/function(t,e,a){
// extracted by mini-css-extract-plugin
/***/},
/***/"600d":
/***/function(t,e,a){"use strict";
/* unused harmony export deviceOrZoneAdd */
/* harmony export (binding) */a.d(e,"j",(function(){return o})),
/* harmony export (binding) */a.d(e,"f",(function(){return u})),
/* harmony export (binding) */a.d(e,"e",(function(){return d})),
/* harmony export (binding) */a.d(e,"i",(function(){return f})),
/* harmony export (binding) */a.d(e,"h",(function(){return m})),
/* harmony export (binding) */a.d(e,"k",(function(){return y})),
/* harmony export (binding) */a.d(e,"l",(function(){return D})),
/* harmony export (binding) */a.d(e,"m",(function(){return v})),
/* harmony export (binding) */a.d(e,"n",(function(){return T})),
/* harmony export (binding) */a.d(e,"b",(function(){return j})),
/* harmony export (binding) */a.d(e,"d",(function(){return x})),
/* harmony export (binding) */a.d(e,"a",(function(){return k})),
/* harmony export (binding) */a.d(e,"g",(function(){return R})),
/* harmony export (binding) */a.d(e,"c",(function(){return N}));
/* harmony import */var n=a("c7eb"),r=a("1da1"),i=a("7424"),c=a("b775");
/* harmony import */function o(){return s.apply(this,arguments)}function s(){return(s=Object(r.a)(Object(n.a)().mark((function t(){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.MONITORTREE,c.b.POST));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function u(t){return l.apply(this,arguments)}function l(){return(l=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.MONITORADD,c.b.POST,e,{timeout:12e6}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d(t){return p.apply(this,arguments)}function p(){return(p=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.PINGICMP,c.b.POST,e,{timeout:12e6}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(t){return h.apply(this,arguments)}function h(){return(h=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.MONITOREDIT,c.b.POST,e,{timeout:12e6}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(t){return b.apply(this,arguments)}function b(){return(b=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.MONITORDEL,c.b.POST,e,{timeout:12e6}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function y(t){return g.apply(this,arguments)}function g(){return(g=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.MONITORREALDATA,c.b.POST,e));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function D(t){return O.apply(this,arguments)}function O(){return(O=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.MONITORREALDATABYUUID,c.b.POST,e));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t){return w.apply(this,arguments)}function w(){return(w=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.SUPPORTDEVICELIST,c.b.POST,e));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function T(t){return S.apply(this,arguments)}function S(){return(S=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.SETDATA,c.b.POST,e,{timeout:1e4}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(t){return A.apply(this,arguments)}function A(){return(A=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.GETDEVICEMODELDATALIST,c.b.POST,e));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t){return M.apply(this,arguments)}function M(){return(M=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.SETDEVICESTARTORSTOP,c.b.POST,e));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(t){return _.apply(this,arguments)}function _(){return(_=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.MONITORCOPY,c.b.POST,e,{timeout:12e6}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function R(t){return C.apply(this,arguments)}function C(){return(C=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.MONITORDELALL,c.b.POST,e,{timeout:12e6}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function N(t){return I.apply(this,arguments)}function I(){return(I=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.GETREALDATATOTABLE,c.b.POST,e,{timeout:12e6}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}
/* unused harmony default export */},
/***/"8b1b":
/***/function(t,e,a){"use strict";
/* harmony import */a("07ed");
/* harmony import */},
/***/"9f9d":
/***/function(t,e,a){"use strict";
// ESM COMPAT FLAG
a.r(e);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
a("b0c0");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"411544a2-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/reporting/dataHistoryReport/dataHistoryQueryReport.vue?vue&type=template&id=9b6eb2ca
var n=a("c7eb"),r=a("1da1"),i=a("b85c"),c=a("2909"),o=a("5530"),s=(a("d9e2"),a("99af"),a("7db0"),a("5db7"),a("a630"),a("caad"),a("d81d"),a("14d9"),a("fb6a"),a("4e82"),a("73d9"),a("e9c4"),a("a9e3"),a("b64b"),a("d3b7"),a("ac1f"),a("6062"),a("1e70"),a("79a4"),a("c1a1"),a("8b00"),a("a4e7"),a("1e5a"),a("72c3"),a("2532"),a("3ca3"),a("5319"),a("0643"),a("fffc"),a("cd1a"),a("4e3e"),a("a573"),a("159b"),a("ddb0"),a("600d")),u=a("c2ec"),l=a("c1df"),d=a.n(l),p=a("cf45"),f=a("f2d9"),h=(a("5c3a"),a("e1d3"),a("90ea"),{name:"DataHistoryQueryReport",i18n:a("89fe"),components:{DownloadExcel:f.a},computed:{
/**
     * 动态计算 a-col 的 md 宽度（基于日期类型）
     * Diy 类型时宽度变小，其他类型宽度正常
     */
getWindowColMd:function(){return"Diy"===this.SelectDateType?10:8;// Diy 时占 6 格，其他占 8 格
},
/**
     * 动态计算输入框宽度（基于日期类型）
     * 适配不同屏幕和日期类型的布局
     */
getWindowInputWidth:function(){return window.innerWidth<992?"100%":"Diy"===this.SelectDateType?"180px":"100%";
// 大屏时：Diy 类型输入框变窄，其他类型正常宽度
}},data:function(){var t=this;
// 完全保留原有 data 定义，仅新增 3 个缓存字段（不影响原有逻辑）
return{moment:d.a,dataWindows:30,pagination:{pageSize:15,showSizeChanger:!0,showTotal:function(e){return"".concat(t.$t("reporting.AlarmHistory.Total")," ").concat(e," ").concat(t.$t("reporting.AlarmHistory.Records"))}},dataZ:[],valueData:"",treePageSize:100,scrollPage:1,frontDataZ:[],loadExecl:null,isLoadExecl:!1,exportName:"",json_fields_cn:{"记录时间":{field:"MainTime",callback:function(t){return Object(p.a)(new Date(t),"yyyy-MM-dd hh:mm:ss")}}},json_fields_en:{"Record Time":{field:"MainTime",callback:function(t){return Object(p.a)(new Date(t),"yyyy-MM-dd hh:mm:ss")}}},json_fields:{},json_meta:[[{key:"charset",value:"utf-8"}]],SelectDateType:"Day",SelectDevice:[],SelectDateRange:d()().format("YYYY-MM-DD"),SelectAlarmData:[],deviceTreeData:[],AlarmDataTree:[],form:this.$form.createForm(this),messageShowLoad:!1,advanced:!0,refIconLoading:!1,baseColumns:[{width:"180px",
// 固定时间列宽度（足够容纳时间字符串）
slotName:"reporting.DataHistory.RecordTime",scopedSlots:{customRender:"MainTime",title:"reporting.DataHistory.RecordTime"},dataIndex:"MainTime",fixed:"left",align:"center",customCell:function(){return{style:{whiteSpace:"nowrap",
// 强制单行
overflow:"hidden",textOverflow:"ellipsis"}}}}],columns:[],dataSource:[],conditionExpress:"",selectedRows:[],
// 新增 3 个缓存字段（仅用于数据处理，不影响原有逻辑）
rawApiData:[],
// 存储接口返回的原始嵌套数据
cacheDeviceNames:[],
// 缓存提取的设备名
cacheDataNames:[]}},authorize:{},mounted:function(){
// 完全保留原有逻辑
this.json_fields="CN"===this.$i18n.locale?Object(o.a)({},this.json_fields_cn):Object(o.a)({},this.json_fields_en),this.exportName="".concat(this.$t("reporting.AlarmHistory.exportName"),"_").concat(Object(p.a)(new Date,"yyyy-MM-dd hh:mm:ss"),".xls")},activated:function(){},filters:{formatDate:function(t){var e=new Date(t);return Object(p.a)(e,"yyyy-MM-dd hh:mm:ss")}},created:function(){
// 完全保留原有逻辑
this.getMonitorTree(),this.columns=Object(c.a)(this.baseColumns)},watch:{$route:function(){this.getMonitorTree()},"$i18n.locale":function(t){this.json_fields="CN"===t?Object(o.a)({},this.json_fields_cn):Object(o.a)({},this.json_fields_en),
// 新增：语言切换时同步更新导出字段（不影响原有逻辑）
this.syncExportFields()}},methods:{
// 完全保留原有所有方法，不做任何修改
chargeDateType:function(t){var e=t.target.value;if("Day"===e)this.SelectDateRange=d()().format("YYYY-MM-DD");else if("Weekly"===e){var a=d()().day(1).format("YYYY-MM-DD"),n=d()().day(7).format("YYYY-MM-DD");this.SelectDateRange=[a,n]}else this.SelectDateRange="Month"===e?d()().format("YYYY-MM"):[d()().add(-1,"day"),d()()]},SelectTreeDevice:function(t,e,a){this.GetDeviceModelDataList()},handleSearch:function(t){var e=this;this.valueData=t,t?(this.frontDataZ=[],this.scrollPage=1,this.dataZ.forEach((function(a){a.name.indexOf(t)>=0&&e.frontDataZ.push(a)})),this.allDataZ=this.frontDataZ,this.frontDataZ=this.frontDataZ.slice(0,100)):this.GetDeviceModelDataList()},handlePopupScroll:function(t){var e=t.target,a=e.scrollHeight-e.scrollTop,n=e.clientHeight;if(0===a&&0===n)this.scrollPage=1;else if(a<n+5){this.scrollPage+=1;var r=Math.min(this.treePageSize*this.scrollPage,this.dataZ.length),i=this.valueData?this.allDataZ.slice(0,r):this.dataZ.slice(0,r);this.frontDataZ=i}},startDownload:function(){this.isLoadExecl=!0,this.loadExecl=this.$message.loading(this.$t("reporting.AlarmHistory.LoadingExecl"),0)},finishDownload:function(){this.$message.destroy(this.loadExecl),this.isLoadExecl=!1},filterOption:function(t,e){return e.componentOptions.children[0].text.toLowerCase().indexOf(t.toLowerCase())>=0},GetDeviceModelDataList:function(t){var e=this;this.AlarmDataTree=[],e.dataZ=[],e.frontDataZ=[];var a={SelectDevice:this.SelectDevice,getType:2};Object(s.b)(a).then((function(t){0===t.data.code&&(t.data.list.forEach((function(t){t.DataList&&t.DataList.length&&t.DataList.forEach((function(t){e.dataZ.push(t),e.AlarmDataTree.push(t)}))})),e.frontDataZ=e.dataZ.slice(0,100))}))},onDateChange:function(t,e){this.SelectDateRange=e},onWeeklyDateChange:function(t,e){var a=d()(t).day(1).format("YYYY-MM-DD"),n=d()(t).day(7).format("YYYY-MM-DD");this.SelectDateRange=[a,n]},getMonitorTree:function(){var t=this;this.deviceTreeData=[],Object(s.j)().then((function(e){0===e.data.code&&(t.deviceTreeData=e.data.list)}))},
// -------------------------- 新增以下 3 个方法（不影响原有逻辑）--------------------------
/**
     * 1. 处理接口返回的嵌套数据：平化为表格结构 + 提取设备名/寄存器名
     * @param {Array} apiData - 接口返回的原始数据（[{ MainTime: "...", Items: [...] }, ...]）
     * @returns {Object} { tableData: 平化后的表格数据, deviceNames: 设备名数组, dataNames: 寄存器名数组 }
     */
handleApiData:function(t){if(!t||!t.length)return{tableData:[],deviceNames:[],dataNames:[]};
// 提取所有设备名（去重）
var e=Array.from(new Set(t.flatMap((function(t){return t.Items.map((function(t){return t.DeviceName}))})))),a=Array.from(new Set(t.flatMap((function(t){return t.Items.map((function(t){return t.DataName}))})))).sort(),n=t.map((function(t,n){var r={key:"row_".concat(n,"_").concat(t.MainTime),
// 生成唯一 key（兼容原有 rowKey 逻辑）
MainTime:t.MainTime};return e.forEach((function(e){a.forEach((function(a){var n=t.Items.find((function(t){return t.DeviceName===e&&t.DataName===a}));r["".concat(e,"_").concat(a)]=n?n.DataValue:"-"}))})),r}));
// 提取所有寄存器名（去重 + 排序）
return{tableData:n,deviceNames:e,dataNames:a}},
/**
     * 2. 生成动态列配置（设备-寄存器列）
     * @param {Array} deviceNames - 设备名数组
     * @param {Array} dataNames - 寄存器名数组
     * @returns {Array} 动态列配置
     */
generateDynamicColumns:function(t,e){return t.length&&e.length?t.flatMap((function(a){return e.map((function(n){return{width:"".concat(88/(t.length*e.length),"%"),dataIndex:"".concat(a,"_").concat(n),key:"".concat(a,"_").concat(n),title:"".concat(a,"(").concat(n,")"),ellipsis:!0,tooltip:!0,sortable:!0,align:"center",sortMethod:function(t,e){return("-"===t?0:Number(t))-("-"===e?0:Number(e))}}}))})):[]},
/**
     * 3. 同步导出字段（追加动态列）
     */
syncExportFields:function(){var t=this;if(this.cacheDeviceNames.length&&this.cacheDataNames.length){var e="CN"===this.$i18n.locale;
// 重置为原始导出字段（避免重复追加）
this.json_fields=e?Object(o.a)({},this.json_fields_cn):Object(o.a)({},this.json_fields_en),
// 追加动态列到导出字段
this.cacheDeviceNames.forEach((function(e){t.cacheDataNames.forEach((function(a){var n="".concat(e,"_").concat(a),r="".concat(e,"(").concat(a,")");t.json_fields[r]=n}))}))}},
// -------------------------- 原有 QueryHistoryDataList 方法（仅新增 4 行处理逻辑）--------------------------
QueryHistoryDataList:function(){var t=this;t.dataSource=[],t.columns=Object(c.a)(t.baseColumns);var e={deviceList:this.SelectDevice,dataList:this.SelectAlarmData,dateType:this.SelectDateType,dateRange:this.SelectDateRange,dataWindows:parseInt(this.dataWindows)};""===e.dateRange||Array.isArray(e.dateRange)&&!e.dateRange[0]?this.$message.error(this.$t("reporting.AlarmHistory.SelectDateError")):(this.messageShowLoad=!0,Object(u.e)(e).then((function(e){if(0===e.data.code){
// 原有逻辑：直接赋值
// _t.dataSource = res.data.list;
// 新增逻辑开始（仅 4 行，不修改原有逻辑）
t.rawApiData=e.data.list;// 存储原始接口数据
var a=t.handleApiData(t.rawApiData),n=a.tableData,r=a.deviceNames,i=a.dataNames;// 处理数据
t.cacheDeviceNames=r,// 缓存设备名
t.cacheDataNames=i,// 缓存寄存器名
// 新增逻辑结束
// 替换原有赋值：使用处理后的表格数据
t.dataSource=n;
// 新增：生成动态列并合并到原有列
var o=t.generateDynamicColumns(r,i);t.columns=[].concat(Object(c.a)(t.baseColumns),Object(c.a)(o)),
// 新增：同步导出字段
t.syncExportFields(),
// 原有逻辑：更新分页和导出文件名
t.pagination.total=t.dataSource.length,t.exportName="".concat(t.$t("reporting.DataHistory.exportName"),"_").concat(Object(p.a)(new Date,"yyyy-MM-dd hh:mm:ss"),".xls")}else t.$message.error(e.data.msg||t.$t("reporting.AlarmHistory.QueryFail"));t.messageShowLoad=!1})).catch((function(e){t.messageShowLoad=!1,t.$message.error(t.$t("reporting.AlarmHistory.QueryFail"))})))},
/**
     * 格式化表格数据为AI易理解的结构
     * @returns {Object} 格式化后的分析数据
     */
formatDataForAI:function(){var t,e,a=this;return this.dataSource.length?{
// 基础查询条件
queryCondition:{deviceList:this.SelectDevice.map((function(t){return a.getDeviceNameById(t)})),
// 设备名称（需实现ID转名称）
dataList:this.SelectAlarmData.map((function(t){return a.getDataNameById(t)})),
// 数据项名称
dateType:this.SelectDateType,dateRange:this.SelectDateRange,timeWindow:this.dataWindows},
// 表格数据（简化版，保留核心值）
tableData:this.dataSource.map((function(t){var e={recordTime:t.MainTime,values:{}};
// 提取设备-寄存器值
return Object.keys(t).forEach((function(a){a.includes("_")&&"key"!==a&&"MainTime"!==a&&(e.values[a]=t[a])})),e})),
// 数据统计信息
statistics:{totalRecords:this.dataSource.length,deviceCount:this.cacheDeviceNames.length,dataItemCount:this.cacheDataNames.length,timeRange:"".concat((null===(t=this.dataSource[0])||void 0===t?void 0:t.MainTime)||""," 至 ").concat((null===(e=this.dataSource[this.dataSource.length-1])||void 0===e?void 0:e.MainTime)||"")}}:null;
// 提取核心分析信息
},
/**
     * 获取设备名称（根据ID，需根据你的设备树数据实现）
     */
getDeviceNameById:function(t){
// 从deviceTreeData中查找设备名称，示例逻辑：
var e=function(t,a){var n,r=Object(i.a)(t);try{for(r.s();!(n=r.n()).done;){var c=n.value;if(c.key===a)return c.text;if(c.children&&c.children.length){var o=e(c.children,a);if(o)return o}}}catch(t){r.e(t)}finally{r.f()}return a;// 找不到返回ID
};return e(this.deviceTreeData,t)},
/**
     * 获取数据项名称（根据ID）
     */
getDataNameById:function(t){var e=this.dataZ.find((function(e){return e.uuid===t}));return e?e.name:t},
/**
     * 构造AI分析提示词
     */
buildAIPrompt:function(){var t=this.formatDataForAI();return t?"CN"===this.$i18n.locale?"请分析以下设备历史数据：\n1. 查询条件：".concat(JSON.stringify(t.queryCondition,null,2),"\n2. 数据统计：共").concat(t.statistics.totalRecords,"条记录，涉及").concat(t.statistics.deviceCount,"台设备，").concat(t.statistics.dataItemCount,"个数据项\n3. 具体数据：").concat(JSON.stringify(t.tableData,null,2),"\n\n请完成以下分析：\n- 数据整体趋势（如数值上升/下降/波动）\n- 异常值识别（如数值超出正常范围、突变）\n- 设备性能分析（不同设备同一指标对比）\n- 关键结论和优化建议\n- 分析结果用Markdown格式返回，语言简洁易懂"):"Please analyze the following device historical data:\n1. Query conditions: ".concat(JSON.stringify(t.queryCondition,null,2),"\n2. Data statistics: Total ").concat(t.statistics.totalRecords," records, involving ").concat(t.statistics.deviceCount," devices, ").concat(t.statistics.dataItemCount," data items\n3. Specific data: ").concat(JSON.stringify(t.tableData,null,2),"\n\nPlease complete the following analysis:\n- Overall data trends (e.g., rising/falling/fluctuating values)\n- Abnormal value identification (e.g., values outside normal range, sudden changes)\n- Device performance analysis (comparison of the same indicator across different devices)\n- Key conclusions and optimization suggestions\n- Return analysis results in Markdown format with concise and understandable language"):"";
// 多语言提示词（适配国际化）
},
/**
     * 调用AI接口进行分析
     */
callAIAnalysis:function(){var t=this;return Object(r.a)(Object(n.a)().mark((function e(){var a,r,i;return Object(n.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.buildAIPrompt()){e.next=4;break}return t.$message.warning(t.$t("reporting.AlarmHistory.NoDataForAnalysis")),e.abrupt("return","");case 4:return e.prev=4,e.next=7,axios({method:"POST",url:"".concat(t.aiConfig.baseURL,"/chat/completions"),headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t.aiConfig.apiKey)},data:{model:t.aiConfig.model,messages:[{role:"user",content:a}],stream:!1},timeout:6e4});case 7:if(!(i=e.sent).data.error||0===i.data.error.code){e.next=10;break}throw new Error("".concat(i.data.error.code,": ").concat(i.data.error.message));case 10:return e.abrupt("return",(null===(r=i.data.choices[0])||void 0===r||null===(r=r.message)||void 0===r?void 0:r.content)||"");case 13:throw e.prev=13,e.t0=e.catch(4),new Error(t.$t("reporting.AlarmHistory.AIAnalysisFail")+(e.t0.message||""));case 16:case"end":return e.stop()}}),e,null,[[4,13]])})))()},
/**
     * 启动AI分析
     */
startAIAnalysis:function(){var t=this;return Object(r.a)(Object(n.a)().mark((function e(){var a;return Object(n.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.dataSource.length){e.next=3;break}return t.$message.warning(t.$t("reporting.AlarmHistory.NoDataForAnalysis")),e.abrupt("return");case 3:return t.isLoadAI=!0,t.showAIResult=!0,t.aiAnalysisResult="",e.prev=6,e.next=9,t.callAIAnalysis();case 9:a=e.sent,
// 将Markdown转为HTML（可选：使用marked库）
t.aiAnalysisResult=a.replace(/### (.*)/g,"<h3>$1</h3>").replace(/## (.*)/g,"<h2>$1</h2>").replace(/### (.*)/g,"<h3>$1</h3>").replace(/\* (.*)/g,"<li>$1</li>").replace(/\n/g,"<br>"),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(6),t.$message.error(e.t0.message),t.aiAnalysisResult='<div style="color: #f5222d;">'.concat(e.t0.message,"</div>");case 17:return e.prev=17,t.isLoadAI=!1,e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[6,13,17,20]])})))()}}}),m=h,b=(a("8b1b"),a("2877")),y=Object(b.a)(m,(function(){var t=this,e=t._self._c;return e("a-card",[e("div",[e("a-form",{attrs:{layout:"horizontal"}},[e("div",{class:t.advanced?null:"fold"},[e("a-row",[e("a-col",{attrs:{md:8,sm:24}},[e("a-form-item",{attrs:{label:t.$t("reporting.AlarmHistory.DeviceList"),labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[e("a-tree-select",{staticStyle:{width:"100%"},attrs:{"show-search":"","tree-node-filter-prop":"title","tree-checkable":"","allow-clear":"","dropdown-style":{maxHeight:"400px",overflow:"auto"},"tree-data":t.deviceTreeData,"replace-fields":{value:"key",title:"text"},placeholder:t.$t("reporting.AlarmHistory.DeviceList"),"tree-default-expand-all":""},on:{change:t.SelectTreeDevice},model:{value:t.SelectDevice,callback:function(e){t.SelectDevice=e},expression:"SelectDevice"}})],1)],1),e("a-col",{attrs:{md:8,sm:24}},[e("a-form-item",{attrs:{label:t.$t("reporting.AlarmHistory.DataList"),labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[e("a-select",{staticStyle:{width:"100%"},attrs:{allowClear:"","show-search":"",optionFilterProp:"children",mode:"multiple","token-separators":[","]},on:{dropdownVisibleChange:t.GetDeviceModelDataList,popupScroll:t.handlePopupScroll,search:t.handleSearch},model:{value:t.SelectAlarmData,callback:function(e){t.SelectAlarmData=e},expression:"SelectAlarmData"}},t._l(t.frontDataZ,(function(a,n){return e("a-select-option",{key:n,attrs:{value:a.uuid}},[t._v(" "+t._s(t.$t(a.name))+" ")])})),1)],1)],1),e("a-col",{attrs:{md:8,sm:24}},[e("a-form-item",{attrs:{label:t.$t("reporting.AlarmHistory.DateType"),labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[e("a-radio-group",{on:{change:t.chargeDateType},model:{value:t.SelectDateType,callback:function(e){t.SelectDateType=e},expression:"SelectDateType"}},[e("a-radio-button",{attrs:{value:"Day"}},[t._v(" "+t._s(t.$t("reporting.AlarmHistory.DateDayType"))+" ")]),e("a-radio-button",{attrs:{value:"Weekly"}},[t._v(" "+t._s(t.$t("reporting.AlarmHistory.DateWeeklyType"))+" ")]),e("a-radio-button",{attrs:{value:"Month"}},[t._v(" "+t._s(t.$t("reporting.AlarmHistory.DateMonthType"))+" ")]),e("a-radio-button",{attrs:{value:"Diy"}},[t._v(" "+t._s(t.$t("reporting.AlarmHistory.DateDiyType"))+" ")])],1)],1)],1)],1),e("a-row",[e("a-col",{attrs:{md:8,sm:24}},[e("a-form-item",{attrs:{label:t.$t("reporting.AlarmHistory.SelectDate"),labelCol:{span:5},wrapperCol:{span:18,offset:1}}},["Day"==t.SelectDateType?e("a-date-picker",{staticStyle:{width:"100%"},attrs:{defaultValue:t.moment(),size:"default",placeholder:t.$t("reporting.AlarmHistory.DateDayType")},on:{change:t.onDateChange}}):t._e(),"Month"==t.SelectDateType?e("a-month-picker",{staticStyle:{width:"100%"},attrs:{defaultValue:t.moment(),size:"default",placeholder:t.$t("reporting.AlarmHistory.DateMonthType")},on:{change:t.onDateChange}}):t._e(),"Weekly"==t.SelectDateType?e("a-week-picker",{staticStyle:{width:"100%"},attrs:{defaultValue:t.moment(),size:"default",placeholder:t.$t("reporting.AlarmHistory.DateWeeklyType")},on:{change:t.onWeeklyDateChange}}):t._e(),"Diy"==t.SelectDateType?e("a-range-picker",{attrs:{"default-value":[t.moment().add(-1,"day"),t.moment()],showTime:!0,size:"default"},on:{change:t.onDateChange}}):t._e()],1)],1),e("a-col",{staticStyle:{"margin-left":"10px"},attrs:{md:t.getWindowColMd,sm:24}},[e("a-form-item",{attrs:{label:t.$t("reporting.AlarmHistory.TimeWindows"),labelCol:{span:6},wrapperCol:{span:10,offset:1}}},[e("a-input",{model:{value:t.dataWindows,callback:function(e){t.dataWindows=e},expression:"dataWindows"}})],1)],1),"Diy"==t.SelectDateType?e("a-col",{attrs:{md:3,sm:24}},[e("span",{staticStyle:{float:"right","margin-top":"3px"}},[e("a-button",{attrs:{disabled:t.messageShowLoad,type:"primary"},on:{click:t.QueryHistoryDataList}},[t._v(t._s(t.$t("reporting.AlarmHistory.Query")))])],1)]):e("a-col",{attrs:{md:2,sm:24}},[e("span",{staticStyle:{float:"right","margin-top":"3px"}},[e("a-button",{attrs:{disabled:t.messageShowLoad,type:"primary"},on:{click:t.QueryHistoryDataList}},[t._v(t._s(t.$t("reporting.AlarmHistory.Query")))])],1)]),e("a-col",{attrs:{md:2,sm:24}},[e("span",{staticStyle:{float:"left","margin-top":"3px"}},[e("download-excel",{staticClass:"export-excel-wrapper",attrs:{data:t.dataSource,fields:t.json_fields,name:t.exportName,"before-generate":t.startDownload,"before-finish":t.finishDownload}},[e("a-button",{staticStyle:{"margin-left":"5px"},attrs:{disabled:t.isLoadExecl||!t.dataSource.length,type:"default"}},[t._v(t._s(t.$t("reporting.AlarmHistory.Export")))])],1)],1)])],1)],1)])],1),e("a-spin",{staticStyle:{padding:"1px"},attrs:{spinning:t.messageShowLoad,tip:"Loading..."}},[t.dataSource.length||t.messageShowLoad?e("a-table",{attrs:{pagination:t.pagination,columns:t.columns,"data-source":t.dataSource,rowKey:function(t){return t.key},scroll:{x:"max-content",scrollToFirstRowOnChange:!0},bo:""},scopedSlots:t._u([t._l(t.columns,(function(a,n){return{key:a.slotName,fn:function(r){return[e("span",{key:n},[t._v(t._s(t.$t(a.slotName)))])]}}})),{key:"MainTime",fn:function(a){return e("span",{},[t._v(" "+t._s(t._f("formatDate")(a))+" ")])}}],null,!0)}):e("div",{staticStyle:{"text-align":"center",padding:"40px",color:"#999"}},[t._v(" "+t._s(t.$t("reporting.AlarmHistory.NoData"))+" ")])],1)],1)}),[],!1,null,null,null)
/* harmony default export */;e.default=y.exports},
/***/c2ec:
/***/function(t,e,a){"use strict";
/* harmony export (binding) */a.d(e,"a",(function(){return o})),
/* harmony export (binding) */a.d(e,"d",(function(){return u})),
/* harmony export (binding) */a.d(e,"e",(function(){return d})),
/* harmony export (binding) */a.d(e,"f",(function(){return f})),
/* harmony export (binding) */a.d(e,"b",(function(){return m})),
/* harmony export (binding) */a.d(e,"c",(function(){return y}));
/* unused harmony export GetHistoryExeclFile */
/* harmony import */var n=a("c7eb"),r=a("1da1"),i=a("7424"),c=a("b775");
/* harmony import */
//历史告警
function o(t){return s.apply(this,arguments)}
//历史数据
function s(){return(s=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.GETHISTORYALARMLIST,c.b.POST,e,{timeout:6e8}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function u(t){return l.apply(this,arguments)}
//历史报表
function l(){return(l=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.GETHISTORYDATALIST,c.b.POST,e,{timeout:6e8}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d(t){return p.apply(this,arguments)}
//自定义数据
function p(){return(p=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.GETHISTORYDATAREPORT,c.b.POST,e,{timeout:6e8}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(t){return h.apply(this,arguments)}function h(){return(h=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.GETDIYHISTORYDATALIST,c.b.POST,e,{timeout:6e8}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(t){return b.apply(this,arguments)}function b(){return(b=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.GETCHARTHISTORYDATALIST,c.b.POST,e,{timeout:6e8}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function y(t){return g.apply(this,arguments)}function g(){return(g=Object(r.a)(Object(n.a)().mark((function t(e){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.g)(i.GETCHARTHISTORYTRENDDATALIST,c.b.POST,e,{timeout:6e8}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}}]);