添加制粉喷煤选择框

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

@ -26,8 +26,30 @@ namespace HT.Cloud.Service.ChartsManage
public async Task<string> GetDriverGroupList() public async Task<string> GetDriverGroupList()
{ {
List<GroupNameList> subsystems = new List<GroupNameList>();
var list_group = _context.Queryable<MetaGroupEntity>().ToList(); var list_group = _context.Queryable<MetaGroupEntity>().ToList();
return list_group.ToJson(); 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> 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() public async Task<string> GetAllSubsystemTag()
@ -44,11 +66,12 @@ namespace HT.Cloud.Service.ChartsManage
return subsystems.ToJson(); return subsystems.ToJson();
} }
public async Task<string> GetSubsystemAllTag(string subsysytemName) public async Task<string> GetSubsystemAllTag(string subsysytemName,string groupDescription)
{ {
var subsysname = subsysytemName; 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>(); var reList = new List<SubAllTagReturn>();
foreach (var subsystem in response) foreach (var subsystem in response)
{ {
@ -95,7 +118,11 @@ namespace HT.Cloud.Service.ChartsManage
public string Lable { get; set; } public string Lable { get; set; }
public string Value { get; set; } public string Value { get; set; }
} }
private class GroupNameList
{
public string Lable { get; set; }
public string Value { get; set; }
}
public class SubAllTagReturn public class SubAllTagReturn
{ {
//x.TagID, x.Description, x.Units //x.TagID, x.Description, x.Units

View File

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using System.Reflection.PortableExecutable;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -15,6 +16,18 @@ namespace HT.Cloud.Service.ReportManage
{ {
public MetaTagAlarmService(ISqlSugarClient context) : base(context) public MetaTagAlarmService(ISqlSugarClient context) : base(context)
{ {
}
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> GetAllSubsystemTag()
{ {
@ -162,6 +175,11 @@ namespace HT.Cloud.Service.ReportManage
public int Hztime { get; set; } public int Hztime { get; set; }
} }
private class SubsysytemNameList private class SubsysytemNameList
{
public string Lable { get; set; }
public string Value { get; set; }
}
private class GroupNameList
{ {
public string Lable { get; set; } public string Lable { get; set; }
public string Value { get; set; } public string Value { get; set; }

View File

@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authorization;
using HT.Cloud.Service.ChartsManage; using HT.Cloud.Service.ChartsManage;
using HT.Cloud.Service.ReportManage; using HT.Cloud.Service.ReportManage;
using Serenity.Services; using Serenity.Services;
using HT.Cloud.Domain.DevicesManage;
namespace HT.Cloud.Web.Areas.ChartsManage.Controllers namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
{ {
@ -23,16 +24,21 @@ namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
{ {
public HistoryChartsService _historyChartsService { get;set;} public HistoryChartsService _historyChartsService { get;set;}
[HttpGet] [HttpGet]
public async Task<ActionResult> GetDriverGroupList() 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(); var data = await _historyChartsService.GetDriverGroupList();
return Content(data); return Content(data);
} }
[HttpPost]
public async Task<ActionResult> GetGroupSubsystemTag(ChartGroupDescription chartGroupDescription)
{
var data = await _historyChartsService.GetGroupSubsystemTag(chartGroupDescription.GroupDescription);
return Content(data);
}
[HttpGet] [HttpGet]
public async Task<ActionResult> GetAllSubsystemTag() public async Task<ActionResult> GetAllSubsystemTag()
{ {
@ -44,7 +50,7 @@ namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
[HttpPost] [HttpPost]
public async Task<ActionResult> GetSubsystemAllTag(ChartSubsysytemName chartSubsysytemName) 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); return Content(data);
} }
@ -84,8 +90,15 @@ namespace HT.Cloud.Web.Areas.ChartsManage.Controllers
public class ChartSubsysytemName public class ChartSubsysytemName
{ {
public string GroupDescription { get; set; }
public string SubsysytemName { get; set; } public string SubsysytemName { get; set; }
} }
public class ChartGroupDescription
{
public string GroupDescription { get; set; }
}
public class HDATETIMEVALUE public class HDATETIMEVALUE
{ {

View File

@ -312,7 +312,9 @@
} else { } } else { }
}); });
GetAllSubsystemTag(); GetDriverGroupList();
//GetAllSubsystemTag();
var starttime = new Date(new Date().setHours(0, 0, 0, 0)); 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(); var starttimeString = starttime.getFullYear() + "-" + parseInt(starttime.getMonth() + 1) + "-" + starttime.getDate() + " " + (starttime.getHours()) + ":" + starttime.getMinutes() + ":" + starttime.getSeconds();
@ -385,7 +387,57 @@
} }
var StaticSelectTagList = new Array(); 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() { async function GetAllSubsystemTag() {
debugger; debugger;
$.ajax({ $.ajax({
@ -410,7 +462,8 @@
} }
//获取选中子系统tag //获取选中子系统tag
updateSelect = async function (data) { 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); //var subsystemAllTag = await Call(api.DataHistoryCharts.GetSubsystemAllTag, para);
debugger; debugger;
myajax = $.ajax({ myajax = $.ajax({
@ -772,6 +825,8 @@
@*<ul id="dataTree" class="dtree" data-id="0"></ul>*@ @*<ul id="dataTree" class="dtree" data-id="0"></ul>*@
<div id="aleft" style="float:left;width:100%;height:100%"> <div id="aleft" style="float:left;width:100%;height:100%">
<div class="easyui-panel" title="选择设备信息" style="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 class="easyui-combobox" id="subsystemselect" name="state" data-options="onSelect:function(rec){updateSelect(rec)}" style="width:100%;height:40px">
</div> </div>
<div class="easyui-datalist" id="subsystemTagList" title="变量列表" style="position: relative;width:100%;height:auto;overflow:auto;" data-options=" <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>*@ @*<ul id="dataTree" class="dtree" data-id="0"></ul>*@
<div id="aleft" style="float:left;width:100%;height:100%"> <div id="aleft" style="float:left;width:100%;height:100%">
<div class="easyui-panel" title="选择设备信息" style="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 class="easyui-combobox" id="subsystemselect" name="state" data-options="onSelect:function(rec){updateSelect(rec)}" style="width:100%;height:40px">
</div> </div>
<div class="easyui-datalist" id="subsystemTagList" title="变量列表" style="position: relative;width:100%;height:auto;overflow:auto;" data-options=" <div class="easyui-datalist" id="subsystemTagList" title="变量列表" style="position: relative;width:100%;height:auto;overflow:auto;" data-options="

View File

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