添加制粉喷煤选择框

This commit is contained in:
dell
2023-07-31 14:01:38 +08:00
parent f897bdeae0
commit 61103308a1
6 changed files with 151 additions and 29 deletions

View File

@ -24,13 +24,35 @@ namespace HT.Cloud.Service.ChartsManage
{
}
public async Task<string> GetDriverGroupList()
{
var list_group = _context.Queryable<MetaGroupEntity>().ToList();
return list_group.ToJson();
}
public async Task<string> GetDriverGroupList()
{
List<GroupNameList> subsystems = new List<GroupNameList>();
var list_group = _context.Queryable<MetaGroupEntity>().ToList();
int i = 0;
foreach (var group in list_group)
{
subsystems.Add(new GroupNameList() { Lable = "a" + i, Value = group.GroupDescription });
i++;
}
return subsystems.ToJson();
}
public async Task<string> GetAllSubsystemTag()
public async Task<string> GetGroupSubsystemTag(string groupDescription)
{
List<SubsysytemNameList> subsystems = new List<SubsysytemNameList>();
var groupId = _context.Queryable<MetaGroupEntity>().Where(x => x.GroupDescription == groupDescription).First().GroupID;
var grouped = _context.Queryable<MetaTagEntity>().ToList().Where(x=>x.GroupID==groupId);
List<string> list_name_two = grouped.Select(t => t.Subsystem).GroupBy(c => c).Select(c => c.First()).ToList();
int i = 0;
foreach (var Meta_Tag in list_name_two)
{
subsystems.Add(new SubsysytemNameList() { Lable = "a" + i, Value = Meta_Tag });
i++;
}
return subsystems.ToJson();
}
public async Task<string> GetAllSubsystemTag()
{
List<SubsysytemNameList> subsystems = new List<SubsysytemNameList>();
var grouped = _context.Queryable<MetaTagEntity>().ToList();
@ -44,11 +66,12 @@ namespace HT.Cloud.Service.ChartsManage
return subsystems.ToJson();
}
public async Task<string> GetSubsystemAllTag(string subsysytemName)
public async Task<string> GetSubsystemAllTag(string subsysytemName,string groupDescription)
{
var subsysname = subsysytemName;
var response = _context.Queryable<MetaTagEntity>().Where(x => x.Subsystem == subsysname).Select(x => new { x.TagID, x.Description, x.Units }).ToList();
var groupId = _context.Queryable<MetaGroupEntity>().Where(x => x.GroupDescription == groupDescription).First().GroupID;
var response = _context.Queryable<MetaTagEntity>().Where(x => x.Subsystem == subsysname&&x.GroupID == groupId).Select(x => new { x.TagID, x.Description, x.Units }).ToList();
var reList = new List<SubAllTagReturn>();
foreach (var subsystem in response)
{
@ -95,8 +118,12 @@ namespace HT.Cloud.Service.ChartsManage
public string Lable { get; set; }
public string Value { get; set; }
}
public class SubAllTagReturn
private class GroupNameList
{
public string Lable { get; set; }
public string Value { get; set; }
}
public class SubAllTagReturn
{
//x.TagID, x.Description, x.Units
public short TagID { get; set; }

View File

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Text;
using System.Threading.Tasks;
@ -16,7 +17,19 @@ namespace HT.Cloud.Service.ReportManage
public MetaTagAlarmService(ISqlSugarClient context) : base(context)
{
}
public async Task<string> GetAllSubsystemTag()
public async Task<string> GetDriverGroupList()
{
List<GroupNameList> subsystems = new List<GroupNameList>();
var list_group = _context.Queryable<MetaGroupEntity>().ToList();
int i = 0;
foreach (var group in list_group)
{
subsystems.Add(new GroupNameList() { Lable = "a" + i, Value = group.GroupDescription});
i++;
}
return subsystems.ToJson();
}
public async Task<string> GetAllSubsystemTag()
{
List<SubsysytemNameList> subsystems = new List<SubsysytemNameList>();
var grouped = repository.IQueryable().ToList();
@ -166,7 +179,12 @@ namespace HT.Cloud.Service.ReportManage
public string Lable { get; set; }
public string Value { get; set; }
}
private class SubAllTagReturn
private class GroupNameList
{
public string Lable { get; set; }
public string Value { get; set; }
}
private class SubAllTagReturn
{
//x.TagID, x.Description, x.Units
public short TagID { get; set; }

View File

@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authorization;
using HT.Cloud.Service.ChartsManage;
using HT.Cloud.Service.ReportManage;
using Serenity.Services;
using HT.Cloud.Domain.DevicesManage;
namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
{
@ -23,17 +24,22 @@ namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
{
public HistoryChartsService _historyChartsService { get;set;}
[HttpGet]
public async Task<ActionResult> GetDriverGroupList()
{
//var StartTime = reportparam.StartTime.ToString("yyyy-MM-dd HH:mm:ss");
//var EndTime = reportparam.EndTime.ToString("yyyy-MM-dd HH:mm:ss");
var data = await _historyChartsService.GetDriverGroupList();
return Content(data);
}
[HttpGet]
[HttpGet]
public async Task<ActionResult> GetDriverGroupList()
{
var data = await _historyChartsService.GetDriverGroupList();
return Content(data);
}
[HttpPost]
public async Task<ActionResult> GetGroupSubsystemTag(ChartGroupDescription chartGroupDescription)
{
var data = await _historyChartsService.GetGroupSubsystemTag(chartGroupDescription.GroupDescription);
return Content(data);
}
[HttpGet]
public async Task<ActionResult> GetAllSubsystemTag()
{
@ -44,7 +50,7 @@ namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
[HttpPost]
public async Task<ActionResult> GetSubsystemAllTag(ChartSubsysytemName chartSubsysytemName)
{
var data = await _historyChartsService.GetSubsystemAllTag(chartSubsysytemName.SubsysytemName);
var data = await _historyChartsService.GetSubsystemAllTag(chartSubsysytemName.SubsysytemName, chartSubsysytemName.GroupDescription);
return Content(data);
}
@ -84,10 +90,17 @@ namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
public class ChartSubsysytemName
{
public string SubsysytemName { get; set; }
}
public string GroupDescription { get; set; }
public string SubsysytemName { get; set; }
public class HDATETIMEVALUE
}
public class ChartGroupDescription
{
public string GroupDescription { get; set; }
}
public class HDATETIMEVALUE
{
public String HDATETIME { get; set; }
public decimal VALUE { get; set; }

View File

@ -312,7 +312,9 @@
} else { }
});
GetAllSubsystemTag();
GetDriverGroupList();
//GetAllSubsystemTag();
var starttime = new Date(new Date().setHours(0, 0, 0, 0));
var starttimeString = starttime.getFullYear() + "-" + parseInt(starttime.getMonth() + 1) + "-" + starttime.getDate() + " " + (starttime.getHours()) + ":" + starttime.getMinutes() + ":" + starttime.getSeconds();
@ -385,7 +387,57 @@
}
var StaticSelectTagList = new Array();
//获取所有子系统列表ok
//获取所有变量组
async function GetDriverGroupList() {
debugger;
$.ajax({
url: "/ChartsManage/HistoryCharts/GetDriverGroupList",
type: "Get",
success: function (redata) {
debugger;
var listsubsysname = JSON.parse(redata);
$('#groupselect').combobox({
data: listsubsysname,
valueField: 'Lable',
textField: 'Value',
value :'请选择系统',
checkOnSelect: true,
selectOnCheck: true
});
$('#subsystemselect').combobox({
value: '请先选择系统',
});
}
});
}
var StaticGroupDescription = "";
updateGroupSelect = async function (data) {
StaticGroupDescription = data.Value;
var para = { "GroupDescription": data.Value }
//var subsystemAllTag = await Call(api.DataHistoryCharts.GetSubsystemAllTag, para);
debugger;
$.ajax({
url: "/ChartsManage/HistoryCharts/GetGroupSubsystemTag",
type: "Post",
//dataType: "json",
data: para,
success: function (redata) {
var listsubsysname = JSON.parse(redata);
$('#subsystemselect').combobox({
data: listsubsysname,
valueField: 'Lable',
textField: 'Value',
value: '请选择子系统',
checkOnSelect: true,
selectOnCheck: true
});
}
});
}
//获取所有子系统列表ok 废弃
async function GetAllSubsystemTag() {
debugger;
$.ajax({
@ -410,7 +462,8 @@
}
//获取选中子系统tag
updateSelect = async function (data) {
var para = { "SubsysytemName": data.Value }
//var groupDescription = ('#groupselect').combobox().getValue();
var para = { "GroupDescription": StaticGroupDescription, "SubsysytemName": data.Value }
//var subsystemAllTag = await Call(api.DataHistoryCharts.GetSubsystemAllTag, para);
debugger;
myajax = $.ajax({
@ -772,6 +825,8 @@
@*<ul id="dataTree" class="dtree" data-id="0"></ul>*@
<div id="aleft" style="float:left;width:100%;height:100%">
<div class="easyui-panel" title="选择设备信息" style="width:100%;height:100%">
<div class="easyui-combobox" id="groupselect" name="group" data-options="onSelect:function(rec){updateGroupSelect(rec)}" style="width:100%;height:40px">
</div>
<div class="easyui-combobox" id="subsystemselect" name="state" data-options="onSelect:function(rec){updateSelect(rec)}" style="width:100%;height:40px">
</div>
<div class="easyui-datalist" id="subsystemTagList" title="变量列表" style="position: relative;width:100%;height:auto;overflow:auto;" data-options="

View File

@ -459,6 +459,8 @@
@*<ul id="dataTree" class="dtree" data-id="0"></ul>*@
<div id="aleft" style="float:left;width:100%;height:100%">
<div class="easyui-panel" title="选择设备信息" style="width:100%;height:100%">
<div class="easyui-combobox" id="groupselect" name="group" data-options="onSelect:function(rec){updateSelect(rec)}" style="width:100%;height:40px">
</div>
<div class="easyui-combobox" id="subsystemselect" name="state" data-options="onSelect:function(rec){updateSelect(rec)}" style="width:100%;height:40px">
</div>
<div class="easyui-datalist" id="subsystemTagList" title="变量列表" style="position: relative;width:100%;height:auto;overflow:auto;" data-options="

View File

@ -23,7 +23,14 @@ namespace HT.Cloud.Web.Areas.ReportManage.Controllers
{
public MetaTagAlarmService _metaTagAlarmService { get;set;}
[HttpGet]
[HttpGet]
public async Task<ActionResult> GetDriverGroupList()
{
var data = await _metaTagAlarmService.GetDriverGroupList();
return Content(data);
}
[HttpGet]
public async Task<ActionResult> GetAllSubsystemTag()
{