diff --git a/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs b/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs index 02e4135..e4b42ee 100644 --- a/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs +++ b/HT.Cloud.Service/ReportManage/MetaTagAlarmService.cs @@ -118,6 +118,19 @@ namespace HT.Cloud.Service.ReportManage var valuelist = DataTableConvertModel.ConvertDataTableToList(dt); return valuelist.ToJson(); + } + //GetAlarmRecordQuickDesc + public async Task GetAlarmRecordQuickDesc(string hhour) + { + int Hhour = int.Parse(hhour); + SugarParameter[] sqlParameters = + { + new SugarParameter("@Hhour",Hhour) + }; + var dt = _context.Ado.UseStoredProcedure().GetDataTable("Query_Tag_Alarm_History", sqlParameters); + var valuelist = DataTableConvertModel.ConvertDataTableToList(dt); + return valuelist.ToJson(); + } public async Task GetAlarmSubSystem(string alarmName) { @@ -131,12 +144,23 @@ namespace HT.Cloud.Service.ReportManage public int hcount { get; set; } public int hztime { get; set; } } + private class AlarmValueCountDesc + { + public string Tagname { get; set; } + public string Description { get; set; } + public string Alarmtype { get; set; } + public string Typename { get; set; } + public string Startdt { get; set; } + public string Enddt { get; set; } + public int Hztime { get; set; } + } private class AlarmValue { public string Description { get; set; } public string startdt { get; set; } public string enddt { get; set; } - } + public int Hztime { get; set; } + } private class SubsysytemNameList { public string Lable { get; set; } diff --git a/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs b/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs index c5d86c0..922649a 100644 --- a/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs +++ b/HT.Cloud.Web/Areas/ReportManage/Controllers/MetaTagAlarmController.cs @@ -58,7 +58,15 @@ namespace HT.Cloud.Web.Areas.ReportManage.Controllers var data = await _metaTagAlarmService.GetAlarmRecordQuick(Alarmtype, StartTime, EndTime); return Content(data); } - [HttpPost] + [HttpPost] + public async Task GetAlarmRecordQuickDesc(Alarm_Quick_Desc_Params alarm_Quick_Desc_Params) + { + var hhour = alarm_Quick_Desc_Params.Hhour; + + var data = await _metaTagAlarmService.GetAlarmRecordQuickDesc(hhour); + return Content(data); + } + [HttpPost] public async Task GetAlarmSubSystem(SubSystem_Params subSystem_Params) { var AlarmName = subSystem_Params.AlarmName; @@ -119,6 +127,10 @@ namespace HT.Cloud.Web.Areas.ReportManage.Controllers public string StartTime { get; set; } public string EndTime { get; set; } } + public class Alarm_Quick_Desc_Params + { + public string Hhour { get; set; } + } } } diff --git a/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml b/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml index 206a019..17ab879 100644 --- a/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml +++ b/HT.Cloud.Web/Areas/ReportManage/Views/MetaTagAlarm/Index.cshtml @@ -25,6 +25,9 @@ //权限控制(js是值传递) //toolbarDemo.innerHTML = common.authorizeButtonNew(toolbarDemo.innerHTML); + + + element.render(); element.on('tab(Chang)',function(data){ if(firstInit){ @@ -41,6 +44,11 @@ //}); }); + var argumentFormSiemens = document.getElementById('recentMd'); + argumentFormSiemens.style.display = 'block'; + var argumentFormSiemens = document.getElementById('classifyMd'); + argumentFormSiemens.style.display = 'none'; + form.on('select(quickTime)', function (data) { var selectValue = data.value; @@ -332,6 +340,18 @@ form.on('select(quickType)', function (data) { var selectValue = data.value; + if (selectValue == 'recent'){ + var argumentFormSiemens = document.getElementById('recentMd'); + argumentFormSiemens.style.display = 'block'; + var argumentFormSiemens = document.getElementById('classifyMd'); + argumentFormSiemens.style.display = 'none'; + }else{ + var argumentFormSiemens = document.getElementById('recentMd'); + argumentFormSiemens.style.display = 'none'; + var argumentFormSiemens = document.getElementById('classifyMd'); + argumentFormSiemens.style.display = 'block'; + } + function getFormatDate(date) { let year = date.getFullYear(); let month = date.getMonth() + 1; @@ -867,32 +887,65 @@ //} showTableQuick = async function () { - showLoading1(); - var showdata = await GetAlarmRecordQuick(); - table.render({ - elem: '#result1', - height: 'full-150', - data: showdata, - //editTrigger:'dblclick', - cols: [[ - //{ type: 'checkbox' }, - //{ field: 'Subsystem', title: '子系统', edit: 'text'}, + debugger; + if (selectType.value == "recent") { + showLoading1(); + var showdata = await GetAlarmRecordQuickDesc(); + table.render({ + elem: '#result1', + height: 'full-150', + data: showdata, + //editTrigger:'dblclick', + cols: [[ + //{ type: 'checkbox' }, + //{ field: 'Subsystem', title: '子系统', edit: 'text'}, - { field: 'Description', title: '报警名称' }, - //{ field: 'TagName' , title:'变量编码' , edit:'text'}, - //{ field: 'Address', title: '起始地址', edit: 'text' }, - //{ field: 'DataType' , title:'数值类型' , edit:'text'}, + { field: 'Description', title: '报警名称' }, + //{ field: 'TagName' , title:'变量编码' , edit:'text'}, + //{ field: 'Address', title: '起始地址', edit: 'text' }, + //{ field: 'DataType' , title:'数值类型' , edit:'text'}, + { field: 'Typename', title: '报警类型' }, + { field: 'Startdt', title: '开始时间' }, + { field: 'Enddt', title: '结束时间' }, + //{ field: 'RtValue' , title:'当前值' , edit:'text'}, + //{ field: 'hcount', title: '报警次数' }, + { field: 'Hztime', title: '报警总时长(秒)' }, + //{ title: '操作', width: 120, toolbar: '#currentTableBar', align: "center", fixed: 'right' }, - //{ field: 'RtValue' , title:'当前值' , edit:'text'}, - { field: 'hcount', title: '报警次数' }, - { field: 'hztime', title: '报警总时长(秒)' }, - { title: '操作', width: 120, toolbar: '#currentTableBar', align: "center", fixed: 'right' }, + ]], + page: true, + limit: 16, + }); + completeLoading1(); + } + else{ + showLoading1(); + var showdata = await GetAlarmRecordQuick(); + table.render({ + elem: '#result1', + height: 'full-150', + data: showdata, + //editTrigger:'dblclick', + cols: [[ + //{ type: 'checkbox' }, + //{ field: 'Subsystem', title: '子系统', edit: 'text'}, - ]], - page: true, - limit: 16, - }); - completeLoading1(); + { field: 'Description', title: '报警名称' }, + //{ field: 'TagName' , title:'变量编码' , edit:'text'}, + //{ field: 'Address', title: '起始地址', edit: 'text' }, + //{ field: 'DataType' , title:'数值类型' , edit:'text'}, + + //{ field: 'RtValue' , title:'当前值' , edit:'text'}, + { field: 'hcount', title: '报警次数' }, + { field: 'hztime', title: '报警总时长(秒)' }, + { title: '操作', width: 120, toolbar: '#currentTableBar', align: "center", fixed: 'right' }, + + ]], + page: true, + limit: 16, + }); + completeLoading1(); + } } table.on('tool(currentTableFilter)', async function (obj) { @@ -997,9 +1050,46 @@ $.when(myajax).done(function (redata) { result = JSON.parse(redata); }); + return result; + } + //获取tagvalue + async function GetAlarmRecordQuickDesc() { + debugger; + let alarmTimeHorizon = $('#selectRecentQuick')[0].value; + let Hhour = 1; + if (alarmTimeHorizon == "onlyOneHour") { + Hhour = 1; + } else if (alarmTimeHorizon == "onlyThreeHour") { + Hhour = 3; + }else if (alarmTimeHorizon == "onlyEightHour") { + Hhour = 8; + } else if (alarmTimeHorizon == "onlyTwelveHour") { + Hhour = 12; + } else if (alarmTimeHorizon == "onlyOneDay") { + Hhour = 24; + } else { + Hhour = 1; + } + //getChecked + //var checkRow = $('#subsystemTagList').datalist("getChecked"); + let datapa = { "Hhour": Hhour }; + let result; + debugger; + myajax = await $.ajax({ + url: "/ReportManage/MetaTagAlarm/GetAlarmRecordQuickDesc", + type: "Post", + //dataType: "json", + data: datapa, + success: function (redata) { } + }); + debugger; + + $.when(myajax).done(function (redata) { + result = JSON.parse(redata); + }); return result; } @@ -1024,6 +1114,7 @@ //{ field: 'RtValue' , title:'当前值' , edit:'text'}, { field: 'startdt', title: '开始时间'}, { field: 'enddt', title: '结束时间' }, + { field: 'Hztime', title: '持续时间' }, ]], page:true, @@ -1125,8 +1216,11 @@
+ + + + + + + +
+ +
@@ -1351,6 +1474,7 @@
+
diff --git a/HT.Cloud.Web/Views/Home/Default.cshtml b/HT.Cloud.Web/Views/Home/Default.cshtml index 3238c3c..4d97535 100644 --- a/HT.Cloud.Web/Views/Home/Default.cshtml +++ b/HT.Cloud.Web/Views/Home/Default.cshtml @@ -309,7 +309,7 @@
-
喷煤量统计
+
给煤量统计
@@ -797,7 +797,7 @@ trigger: 'axis' }, legend: { - data: ['喷煤量(T)'] + data: ['给煤量(T)'] }, xAxis: { type: 'category', @@ -829,7 +829,7 @@ }, }, yAxis: { - name: '喷煤量(T)', + name: '给煤量(T)', nameLocation: 'center', axisTick: { show:true, @@ -869,7 +869,7 @@ }, series: [ { - name: '喷煤量(T)', type: 'line', + name: '给煤量(T)', type: 'line', data: yData, lineStyle: { normal: { diff --git a/HT.Cloud.Web/wwwroot/report/报表预设模板.xlsx b/HT.Cloud.Web/wwwroot/report/报表预设模板.xlsx index e7ccbeb..1b07137 100644 Binary files a/HT.Cloud.Web/wwwroot/report/报表预设模板.xlsx and b/HT.Cloud.Web/wwwroot/report/报表预设模板.xlsx differ