新版推送
This commit is contained in:
@ -685,6 +685,23 @@
|
||||
3、构建实时趋势,设置曲线数据从采集服务中的实时数据中每秒增加数据,最大数据量50个。
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
*一
|
||||
1、调整报警记录统计界面样式,将报警明细汇总表格和图表显示集中在同一界面。
|
||||
2、修改报警图表数据查询函数为新的存储过程,调用曲工新的仿真数据。
|
||||
*二
|
||||
1、柱状图JS绘制方法加载新的返回数据格式,绘制为按照报警次数显示。
|
||||
2、L2管理平台ppt制作。
|
||||
*三
|
||||
L2管理平台ppt制作。
|
||||
*四
|
||||
1、部署modbus驱动测试程序,测试读取效率。
|
||||
2、实时趋势开启后台异步加载,初始化后异步加载12小时的历史数据。
|
||||
*五
|
||||
实时趋势添加缩放区域拖拽条,在鼠标滚动的基础上可自由拖动显示的时间跨度。
|
||||
*/
|
||||
|
||||
//for (var ci = 0; ci < StaticSelectTagList.length; ci++) {
|
||||
// if (ci == 0) {
|
||||
// let yAxisdata = {
|
||||
@ -815,10 +832,32 @@
|
||||
let legenddata = StaticSelectTagList[li].Description;
|
||||
legend.push(JSON.parse(JSON.stringify(legenddata)));
|
||||
}
|
||||
var dataZoom = {
|
||||
//type: 'slider'
|
||||
type: 'inside'
|
||||
}
|
||||
var dataZoom = [
|
||||
// {
|
||||
// textStyle: {
|
||||
// color: '#8392A5'
|
||||
// },
|
||||
// handleIcon:
|
||||
// 'path://M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
|
||||
// dataBackground: {
|
||||
// areaStyle: {
|
||||
// color: '#8392A5'
|
||||
// },
|
||||
// lineStyle: {
|
||||
// opacity: 0.8,
|
||||
// color: '#8392A5'
|
||||
// }
|
||||
// },
|
||||
// brushSelect: true
|
||||
// },
|
||||
{
|
||||
type: 'inside',
|
||||
start: 80,
|
||||
},
|
||||
{
|
||||
type:'slider'
|
||||
}
|
||||
]
|
||||
|
||||
var option = {
|
||||
xAxis: {
|
||||
@ -910,16 +949,16 @@
|
||||
|
||||
let axisData = RtData[0][0].name;
|
||||
for (var stl = 0; stl < StaticSelectTagList.length; stl++) {
|
||||
if (option.series[stl].data.length > 49) {
|
||||
option.series[stl].data.shift();
|
||||
}
|
||||
// if (option.series[stl].data.length > 49) {
|
||||
// option.series[stl].data.shift();
|
||||
// }
|
||||
option.series[stl].data.push(RtData[stl][0].value);
|
||||
}
|
||||
|
||||
if (option.xAxis[0].data.length > 49) {
|
||||
option.xAxis[0].data.shift();
|
||||
// if (option.xAxis[0].data.length > 49) {
|
||||
// option.xAxis[0].data.shift();
|
||||
|
||||
}
|
||||
// }
|
||||
option.xAxis[0].data.push(axisData);
|
||||
|
||||
myChart.setOption(option);
|
||||
|
@ -86,6 +86,17 @@ namespace HT.Cloud.Web.Areas.ReportManage.Controllers
|
||||
return Content(data);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmHistory(Alarm_History_Params alarm_History_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var StartTime = Gettime(alarm_History_Params.StartTime);
|
||||
var EndTime = Gettime(alarm_History_Params.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarmHistory(StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmSubSystem(SubSystem_Params subSystem_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
@ -214,7 +225,11 @@ namespace HT.Cloud.Web.Areas.ReportManage.Controllers
|
||||
{
|
||||
public string Hhour { get; set; }
|
||||
}
|
||||
|
||||
public class Alarm_History_Params
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class Alarm_ACC_Params
|
||||
|
@ -0,0 +1,307 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using HT.Cloud.Code;
|
||||
using HT.Cloud.Domain.ChartsManage;
|
||||
using HT.Cloud.Service;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using HT.Cloud.Service.ChartsManage;
|
||||
using HT.Cloud.Service.ReportManage;
|
||||
using Serenity.Services;
|
||||
using HT.Cloud.Domain.DevicesManage;
|
||||
using SqlSugar;
|
||||
|
||||
namespace HT.Cloud.Web.Areas.ReportManage.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 创 建:cdl
|
||||
/// 日 期:2023-02-23 11:10
|
||||
/// 描 述:历史趋势控制器类
|
||||
/// </summary>
|
||||
[Area("PenMeiReportManage")]
|
||||
public class PenMeiHistoryAlarmNewNewController : BaseController
|
||||
{
|
||||
public HistoryAlarmService _historyAlarmService { get;set;}
|
||||
/// <summary>
|
||||
/// 绑定数据仓库的数据库ID
|
||||
/// </summary>
|
||||
private string groupDescription = GlobalContext.SystemConfig.GroupDescription;
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetDriverGroupList()
|
||||
{
|
||||
var data = await _historyAlarmService.GetDriverGroupList();
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetAllSubsystemTag()
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var data = await _historyAlarmService.GetAllSubsystemTag(systemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetSubsystemAllTag(ChartSubsysytemName chartSubsysytemName)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var data = await _historyAlarmService.GetSubsystemAllTag(chartSubsysytemName.SubsysytemName, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmRecord(Alarm_Params charts_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
short TagID = short.Parse(charts_Params.TagID);
|
||||
var StartTime = Gettime(charts_Params.StartTime);
|
||||
var EndTime = Gettime(charts_Params.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarmRecord(TagID, StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmRecordQuick(Alarm_Quick_Params alarm_Quick_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var Alarmtype = alarm_Quick_Params.Alarmtype;
|
||||
var StartTime = Gettime(alarm_Quick_Params.StartTime);
|
||||
var EndTime = Gettime(alarm_Quick_Params.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarmRecordQuick(Alarmtype, StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmRecordQuickDesc(Alarm_Quick_Desc_Params alarm_Quick_Desc_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var hhour = alarm_Quick_Desc_Params.Hhour;
|
||||
|
||||
var data = await _historyAlarmService.GetAlarmRecordQuickDesc(hhour, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmHistory(Alarm_History_Params alarm_History_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var StartTime = Gettime(alarm_History_Params.StartTime);
|
||||
var EndTime = Gettime(alarm_History_Params.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarmHistory(StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmSubSystem(SubSystem_Params subSystem_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var AlarmName = subSystem_Params.AlarmName;
|
||||
var data = await _historyAlarmService.GetAlarmSubSystem(AlarmName,systemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
public string Gettime(string longtime)
|
||||
{
|
||||
long jsTimeStamp = long.Parse(longtime);
|
||||
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
|
||||
DateTime dt = startTime.AddMilliseconds(jsTimeStamp);
|
||||
return (dt.ToString("yyyy/MM/dd HH:mm:ss"));
|
||||
}
|
||||
|
||||
public string Gettime_(string longtime)
|
||||
{
|
||||
long jsTimeStamp = long.Parse(longtime);
|
||||
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
|
||||
DateTime dt = startTime.AddMilliseconds(jsTimeStamp);
|
||||
return (dt.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmACC(Alarm_ACC_Params alarm_ACC_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var StartTime = Gettime(alarm_ACC_Params.StartTime);
|
||||
var EndTime = Gettime(alarm_ACC_Params.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarm_ACC(StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmHistogram(Alarm_Histogram_Params alarm_Histogram_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var StartTime = Gettime_(alarm_Histogram_Params.StartTime);
|
||||
var EndTime = Gettime_(alarm_Histogram_Params.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarm_Histogram(StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmPie(Alarm_Pie_Params alarm_Pie_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var StartTime = Gettime(alarm_Pie_Params.StartTime);
|
||||
var EndTime = Gettime(alarm_Pie_Params.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarm_Pie(StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> GetAlarmRecordForTagName(Alarm_ParamsForTagName charts_Params)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
string Description = charts_Params.Description;
|
||||
var StartTime = Gettime(charts_Params.StartTime);
|
||||
var EndTime = Gettime(charts_Params.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarmRecordForTagName(Description, StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
public async Task<ActionResult> GetAlarm_CS(Alarm_CS alarm_CS)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var StartTime = Gettime_(alarm_CS.StartTime);
|
||||
var EndTime = Gettime_(alarm_CS.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarm_CS(StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
|
||||
public async Task<ActionResult> GetAlarm_Ztime(Alarm_Ztime alarm_Ztime)
|
||||
{
|
||||
string systemName = "喷煤系统";
|
||||
|
||||
var StartTime = Gettime_(alarm_Ztime.StartTime);
|
||||
var EndTime = Gettime_(alarm_Ztime.EndTime);
|
||||
|
||||
var data = await _historyAlarmService.GetAlarm_Ztime(StartTime, EndTime, systemName);
|
||||
return Content(data);
|
||||
}
|
||||
/*
|
||||
* 一
|
||||
* 1、重绘管理系统所有趋势曲线,曲线的数据点上不在绘制图形圆点。
|
||||
* 2、实时趋势开放拖动和JS代码添加可向前加载数据集的动态方法。
|
||||
* 二
|
||||
* 1、后台服务在获取实时趋势初始化数据时进行向前的数据获取,为初始数据集添加一段历史数据。
|
||||
* 2、参加公司组织的拍摄技术培训。
|
||||
* 三
|
||||
* 1、使用异步和函数回调来执行历史数据查询,在实时数据获取后进行时间戳对其,避免出现重复时间和漏掉时间。
|
||||
* 2、报警分析柱图优化,单日柱状图从堆叠图修改为平铺柱状图。
|
||||
* 四
|
||||
* 1、柱状图添加工具条,可支持堆叠图、平铺图、折线图切换显示,并支持下载功能。
|
||||
* 2、添加图表联动功能,增加柱状图和饼图的点击事件,在柱状区域或饼状区域内点击可跳转至该报警信息的详细查询。
|
||||
* 五
|
||||
* 1、
|
||||
* 2、整理管理系统以前相关的设计、宣传素材,编写管理系统演示用ppt。
|
||||
*/
|
||||
//public class SubAllTagReturn
|
||||
//{
|
||||
// //x.TagID, x.Description, x.Units
|
||||
// public short TagID { get; set; }
|
||||
// public string Description { get; set; }
|
||||
// public string Units { get; set; }
|
||||
//}
|
||||
|
||||
//public class SubsysytemNameList
|
||||
//{
|
||||
// public string Lable { get; set; }
|
||||
// public string Value { get; set; }
|
||||
//}
|
||||
|
||||
public class ChartSubsysytemName
|
||||
{
|
||||
public string SubsysytemName { get; set; }
|
||||
}
|
||||
|
||||
//public class HDATETIMEVALUE
|
||||
//{
|
||||
// public String HDATETIME { get; set; }
|
||||
// public decimal VALUE { get; set; }
|
||||
//}
|
||||
//public class ChartData
|
||||
//{
|
||||
// public decimal value { get; set; }
|
||||
// public String name { get; set; }
|
||||
//}
|
||||
public class SubSystem_Params
|
||||
{
|
||||
public string AlarmName { get; set; }
|
||||
}
|
||||
public class Alarm_Params
|
||||
{
|
||||
public string TagID { get; set; }
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
|
||||
public class Alarm_ParamsForTagName
|
||||
{
|
||||
public string Description { get; set; }
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
|
||||
public class Alarm_Quick_Params
|
||||
{
|
||||
public string Alarmtype { get; set; }
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
public class Alarm_Quick_Desc_Params
|
||||
{
|
||||
public string Hhour { get; set; }
|
||||
}
|
||||
public class Alarm_History_Params
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class Alarm_ACC_Params
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
public class Alarm_Histogram_Params
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
public class Alarm_Pie_Params
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
|
||||
public class Alarm_CS
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
|
||||
public class Alarm_Ztime
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
/*******************************************************************************
|
||||
* Copyright © 2020 HT.Cloud.Framework 版权所有
|
||||
* Author: HT.Cloud
|
||||
* Description: WaterCloud快速开发平台
|
||||
* Website:
|
||||
*********************************************************************************/
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using HT.Cloud.Code;
|
||||
using HT.Cloud.Service.SystemSecurity;
|
||||
|
||||
namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers
|
||||
{
|
||||
[Area("PenMeiReportManage")]
|
||||
[HandlerLogin(needLogin: false)]
|
||||
[HandlerAuthorize(needAuth: false)]
|
||||
public class PenMeiJMReportController : BaseController
|
||||
{
|
||||
public ServerStateService _serverStateService { get; set; }
|
||||
public RealTimeIOState _realTimeIOState { get; set; }
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetServerDataJson()
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
/*
|
||||
* 一
|
||||
* 1、安装java集成开发环境,根据示例重构jimu报表的代码。
|
||||
* 2、jimu报表的java环境继承到.Net中过于繁琐和前端功能较简单放弃使用jumu报表,使用另一款.Net作为服务端的cell报表。
|
||||
* 二
|
||||
* 1、下载cell报表前端源码,安装前端Vue3源码环境,通过反编译补全功能代码和与后端的Api请求。
|
||||
* 2、去除无用功能和界面,只保留报表功能,将所有原项目logo和名称标记替换为恒拓相关。
|
||||
* 三
|
||||
* 1、获取cellreport后端源码,编辑源码库的静态资源,下载补全项目引用的开源类库。
|
||||
* 2、修改水印函数库文件,将唯一不可修改的导出pdf水印替换为空或恒拓环保科技。
|
||||
* 四
|
||||
* 1、将前端和后端源码编译打包,重构项目运行结构,前后端集成为一个服务实力,部署测试。
|
||||
* 2、报表软件交给曲工进行报表编辑和运行测试,同时进行debug调试。
|
||||
* 五
|
||||
* 1、将曲工编辑好的报表集成至管理平台。
|
||||
* 2、比较JS自动绘图组件,选择适合自动生成的组件进行io模块自动构建。
|
||||
*/
|
||||
//windows环境
|
||||
var computer = ComputerHelper.GetComputerInfo();
|
||||
var arm = computer.RAMRate;
|
||||
var cpu = computer.CPURate;
|
||||
var iis = computer.RunTime;
|
||||
var TotalRAM = computer.TotalRAM;
|
||||
string ip = WebHelper.GetWanIp();
|
||||
string ipLocation = WebHelper.GetIpLocation(ip);
|
||||
var IP = string.Format("{0} ({1})", ip, ipLocation);
|
||||
return Content(new { ARM = arm, CPU = cpu, IIS = iis, TotalRAM = TotalRAM, IP = IP }.ToJson());
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetServerData()
|
||||
{
|
||||
var data = (await _serverStateService.GetList(2)).OrderBy(a => a.F_Date).ToList();
|
||||
return Content(data.ToJson());
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetRealIOState()
|
||||
{
|
||||
var data = _realTimeIOState.GetRtData();
|
||||
return Content(data.Result);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,327 @@
|
||||
@{
|
||||
ViewBag.Title = "Index";
|
||||
Layout = "~/Views/Shared/_Index.cshtml";
|
||||
}
|
||||
@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment env
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<style>
|
||||
|
||||
.layui-card {
|
||||
border: 1px solid #f2f2f2;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-right: 10px;
|
||||
color: #1aa094;
|
||||
}
|
||||
|
||||
.icon-cray {
|
||||
color: #ffb800 !important;
|
||||
}
|
||||
|
||||
.icon-blue {
|
||||
color: #1e9fff !important;
|
||||
}
|
||||
|
||||
.icon-tip {
|
||||
color: #ff5722 !important;
|
||||
}
|
||||
|
||||
.layuimini-qiuck-module {
|
||||
text-align: center;
|
||||
margin-top: 10px
|
||||
}
|
||||
|
||||
.layuimini-qiuck-module a i {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
font-size: 30px;
|
||||
background-color: #F8F8F8;
|
||||
color: #333;
|
||||
transition: all .3s;
|
||||
-webkit-transition: all .3s;
|
||||
}
|
||||
|
||||
.layuimini-qiuck-module a cite {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
display: block;
|
||||
color: #666;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.welcome-module {
|
||||
width: 100%;
|
||||
height: 210px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
background-color: #fff;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,.05)
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
padding: 10px
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: 12px;
|
||||
color: inherit
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline;
|
||||
padding: .2em .6em .3em;
|
||||
font-size: 75%;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25em;
|
||||
margin-top: .3em;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline;
|
||||
padding: .2em .6em .3em;
|
||||
font-size: 75%;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25em;
|
||||
margin-top: .3em;
|
||||
}
|
||||
|
||||
.layui-red {
|
||||
color: red
|
||||
}
|
||||
|
||||
.main_btn > p {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.layui-bg-number {
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
|
||||
.layuimini-notice:hover {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
.layuimini-notice {
|
||||
padding: 7px 16px;
|
||||
clear: both;
|
||||
font-size: 12px !important;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
transition: background 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.layuimini-notice-title, .layuimini-notice-label {
|
||||
padding-right: 70px !important;
|
||||
text-overflow: ellipsis !important;
|
||||
overflow: hidden !important;
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
.layuimini-notice-title {
|
||||
line-height: 28px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.layuimini-notice-extra {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
right: 16px;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
layui.use(['layer', 'echarts', 'common'], function () {
|
||||
var $ = layui.jquery,
|
||||
layer = layui.layer,
|
||||
common = layui.common,
|
||||
echarts = layui.echarts;
|
||||
wcLoading.close();
|
||||
const leafer = new LeaferUI.Leafer({
|
||||
view: 'idmain', // 支持 window 、div、canvas 标签对象, 可使用id字符串(不用加 # 号)
|
||||
width: 1000, // 不能设置为 0, 否则会变成自动布局
|
||||
height: 900,
|
||||
})
|
||||
|
||||
const group = new LeaferUI.Group({ x: 0, y: 0, scaleX: 1, scaleY: 1 })
|
||||
|
||||
const box = new LeaferUI.Box({ x: 50, y: 50, width:400,height:800, fill: '#707980', draggable: true })
|
||||
|
||||
for(var linexid = 0;linexid<19;linexid++)
|
||||
{
|
||||
var line = new LeaferUI.Line({
|
||||
x: 0,
|
||||
y: (linexid+1) * 40,
|
||||
width: 400,
|
||||
strokeWidth: 1,
|
||||
stroke: 'rgb(50,205,121)',
|
||||
id: "line" + linexid.toString()
|
||||
});
|
||||
box.add(line);
|
||||
}
|
||||
var spiltline = new LeaferUI.Line({
|
||||
x:200,
|
||||
width:800,
|
||||
rotation:90,
|
||||
stroke:'rgb(50,205,121)',
|
||||
strokeWidth:1,
|
||||
dashPattern = [5, 2]
|
||||
})
|
||||
box.add(spiltline);
|
||||
for(var sid = 0;sid<16;sid++)
|
||||
{
|
||||
let y =0 ;
|
||||
if(sid<8)
|
||||
{
|
||||
y = 40*(sid) + 55;
|
||||
}
|
||||
if(sid>=8)
|
||||
{
|
||||
y = 40*(sid+2) + 55;
|
||||
}
|
||||
var rect_left = new LeaferUI.Rect({
|
||||
x:50,
|
||||
//y:30*(sid) + 40,
|
||||
y:y,
|
||||
height:10,
|
||||
width:20,
|
||||
fill:'#55557f',
|
||||
draggable:false,
|
||||
id:'io'+sid.toString()
|
||||
})
|
||||
var rect_left_text_name = new LeaferUI.Text({
|
||||
x:5,
|
||||
y:y-3,
|
||||
//height:10,
|
||||
width:40,
|
||||
fill: '#5aa585',
|
||||
text:'DO 0.X',
|
||||
ITextAlign :'left',
|
||||
IVerticalAlign:'top',
|
||||
textWrap:'none',
|
||||
padding:0,
|
||||
fontSize:12
|
||||
})
|
||||
var rect_left_text_description = new LeaferUI.Text({
|
||||
x:80,
|
||||
y:y-3,
|
||||
//height:10,
|
||||
width:80,
|
||||
fill: '#20343c',
|
||||
text:'1罐大卸压阀输出',
|
||||
ITextAlign :'left',
|
||||
IVerticalAlign:'top',
|
||||
textWrap:'none',
|
||||
padding:0,
|
||||
fontSize:12
|
||||
})
|
||||
//1罐仓流化阀原输出
|
||||
var rect_right = new LeaferUI.Rect({
|
||||
x:330,
|
||||
//y:30*(sid) + 40,
|
||||
y:y,
|
||||
height:10,
|
||||
width:20,
|
||||
fill:'#55557f',
|
||||
draggable:false,
|
||||
id:'io'+(sid+16).toString()
|
||||
})
|
||||
//console.log(rect)
|
||||
box.add(rect_left);
|
||||
box.add(rect_left_text_name);
|
||||
box.add(rect_left_text_description);
|
||||
box.add(rect_right);
|
||||
}
|
||||
|
||||
//const rect2 = new LeaferUI.Rect({ x: 0, y: 0, width: 100, height: 100, fill: '#09300e', draggable: true })
|
||||
|
||||
leafer.add(group)
|
||||
group.add(box)
|
||||
//box.add(rect2)
|
||||
|
||||
var t = null;
|
||||
function time() {
|
||||
clearTimeout(t); //清除定时器
|
||||
UpdataChart()
|
||||
t = setTimeout(time, 1 * 1000); //设定定时器,循环运行
|
||||
|
||||
}
|
||||
async function UpdataChart() {
|
||||
|
||||
myajax = await $.ajax({
|
||||
url: "/PenMeiReportManage/PenMeiJMReport/GetRealIOState",
|
||||
type: "Get",
|
||||
dataType: "json",
|
||||
// traditional: true,//这里设置为true
|
||||
// data: { charts_TagNames: SelectTagNamelist },
|
||||
success: function (redata) {
|
||||
|
||||
}
|
||||
});
|
||||
$.when(myajax).done(function (redata) {
|
||||
debugger;
|
||||
for(var ioName in redata)
|
||||
{
|
||||
leafer.findOne('#'+ioName).fill =(redata[ioName] == '1') ? '#d4d04e' : '#9f9f91';
|
||||
debugger;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
t = setTimeout(time, 1 * 1000); //开始运行
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
<script type="text/javascript" src="~/lib//leafer-ui@1.0.0-rc.8/web.js"></script>
|
||||
<div style ="width:100%;height:100%;">
|
||||
<div class="layuimini-container" style="width:100%;height:100%;">
|
||||
<div id = "idmain">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div style ="width:100%;height:100%;">
|
||||
<div class="layuimini-container" style="width:100%;height:100%;">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md15">
|
||||
<iframe style="width:100%;height:95vh" src="http://192.168.110.247:8250/run?reportName=HTTEST/%E6%8A%A5%E8%AD%A6%E6%B1%87%E6%80%BB.cr"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
@ -4,6 +4,7 @@ using System.Threading.Tasks;
|
||||
using HT.Cloud.Service.ChartsManage;
|
||||
using HT.Cloud.Service.ReportManage;
|
||||
using HT.Cloud.Code;
|
||||
using HT.Cloud.Service.SystemSecurity;
|
||||
|
||||
namespace HT.Cloud.Web.Areas.ReportManage.Controllers
|
||||
{
|
||||
|
@ -0,0 +1,46 @@
|
||||
/*******************************************************************************
|
||||
* Copyright © 2020 HT.Cloud.Framework 版权所有
|
||||
* Author: HT.Cloud
|
||||
* Description: WaterCloud快速开发平台
|
||||
* Website:
|
||||
*********************************************************************************/
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using HT.Cloud.Code;
|
||||
using HT.Cloud.Service.SystemSecurity;
|
||||
|
||||
namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers
|
||||
{
|
||||
[Area("SystemSecurity")]
|
||||
public class DeviceIOController : BaseController
|
||||
{
|
||||
public ServerStateService _serverStateService { get; set; }
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetServerDataJson()
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
//windows环境
|
||||
var computer = ComputerHelper.GetComputerInfo();
|
||||
var arm = computer.RAMRate;
|
||||
var cpu = computer.CPURate;
|
||||
var iis = computer.RunTime;
|
||||
var TotalRAM = computer.TotalRAM;
|
||||
string ip = WebHelper.GetWanIp();
|
||||
string ipLocation = WebHelper.GetIpLocation(ip);
|
||||
var IP = string.Format("{0} ({1})", ip, ipLocation);
|
||||
return Content(new { ARM = arm, CPU = cpu, IIS = iis, TotalRAM = TotalRAM, IP = IP }.ToJson());
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetServerData()
|
||||
{
|
||||
var data = (await _serverStateService.GetList(2)).OrderBy(a => a.F_Date).ToList();
|
||||
return Content(data.ToJson());
|
||||
}
|
||||
}
|
||||
}
|
297
HT.Cloud.Web/Areas/SystemSecurity/Views/DeviceIO/Index.cshtml
Normal file
297
HT.Cloud.Web/Areas/SystemSecurity/Views/DeviceIO/Index.cshtml
Normal file
@ -0,0 +1,297 @@
|
||||
@{
|
||||
ViewBag.Title = "Index";
|
||||
Layout = "~/Views/Shared/_Index.cshtml";
|
||||
}
|
||||
@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment env
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<style>
|
||||
|
||||
.layui-card {
|
||||
border: 1px solid #f2f2f2;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-right: 10px;
|
||||
color: #1aa094;
|
||||
}
|
||||
|
||||
.icon-cray {
|
||||
color: #ffb800 !important;
|
||||
}
|
||||
|
||||
.icon-blue {
|
||||
color: #1e9fff !important;
|
||||
}
|
||||
|
||||
.icon-tip {
|
||||
color: #ff5722 !important;
|
||||
}
|
||||
|
||||
.layuimini-qiuck-module {
|
||||
text-align: center;
|
||||
margin-top: 10px
|
||||
}
|
||||
|
||||
.layuimini-qiuck-module a i {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
font-size: 30px;
|
||||
background-color: #F8F8F8;
|
||||
color: #333;
|
||||
transition: all .3s;
|
||||
-webkit-transition: all .3s;
|
||||
}
|
||||
|
||||
.layuimini-qiuck-module a cite {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
display: block;
|
||||
color: #666;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.welcome-module {
|
||||
width: 100%;
|
||||
height: 210px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
background-color: #fff;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,.05)
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
padding: 10px
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: 12px;
|
||||
color: inherit
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline;
|
||||
padding: .2em .6em .3em;
|
||||
font-size: 75%;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25em;
|
||||
margin-top: .3em;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline;
|
||||
padding: .2em .6em .3em;
|
||||
font-size: 75%;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25em;
|
||||
margin-top: .3em;
|
||||
}
|
||||
|
||||
.layui-red {
|
||||
color: red
|
||||
}
|
||||
|
||||
.main_btn > p {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.layui-bg-number {
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
|
||||
.layuimini-notice:hover {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
.layuimini-notice {
|
||||
padding: 7px 16px;
|
||||
clear: both;
|
||||
font-size: 12px !important;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
transition: background 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.layuimini-notice-title, .layuimini-notice-label {
|
||||
padding-right: 70px !important;
|
||||
text-overflow: ellipsis !important;
|
||||
overflow: hidden !important;
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
.layuimini-notice-title {
|
||||
line-height: 28px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.layuimini-notice-extra {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
right: 16px;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
layui.use(['layer', 'echarts', 'common'], function () {
|
||||
var $ = layui.jquery,
|
||||
layer = layui.layer,
|
||||
common = layui.common,
|
||||
echarts = layui.echarts;
|
||||
common = layui.common;
|
||||
common.iframeInterval(function () {
|
||||
loadInfo();
|
||||
}, 10000); //指定10秒刷新一次
|
||||
$(function () {
|
||||
loadInfo();
|
||||
loadChart();
|
||||
});
|
||||
wcLoading.close();
|
||||
function loadInfo() {
|
||||
$.ajax({
|
||||
url: "/SystemSecurity/ServerMonitoring/GetServerDataJson?v=" + new Date().Format("yyyy-MM-dd hh:mm:ss"),
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#cpucout').html(data.CPU + "%");
|
||||
$('#armcout').html(data.ARM + "%");
|
||||
$('#TotalRAM').html(data.TotalRAM);
|
||||
$('#OutIP').html(data.IP);
|
||||
}
|
||||
});
|
||||
}
|
||||
function loadChart() {
|
||||
var myChart = echarts.init(document.getElementById('echarts-records'), 'walden');
|
||||
var xData = [];
|
||||
var armData = [];
|
||||
var cpuData = [];
|
||||
common.ajax({
|
||||
url: "/SystemSecurity/ServerMonitoring/GetServerData",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
var length = data.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
if (data[i]['F_Date'] !== null) {
|
||||
xData.push(new Date(data[i]['F_Date']).Format("yyyy-MM-dd"));
|
||||
}
|
||||
if (data[i]['F_ARM'] !== null) {
|
||||
armData.push(data[i]['F_ARM']);
|
||||
}
|
||||
if (data[i]['F_CPU'] !== null) {
|
||||
cpuData.push(data[i]['F_CPU']);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
option = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: ['CPU使用率', 'ARM使用率']
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: xData
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'CPU使用率', type: 'line',
|
||||
data: cpuData,
|
||||
lineStyle: {
|
||||
normal: {
|
||||
width: 2
|
||||
}
|
||||
},
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
showAllSymbol: true,
|
||||
color: '#2499F8',
|
||||
},
|
||||
{
|
||||
name: 'ARM使用率', type: 'line',
|
||||
data: armData,
|
||||
lineStyle: {
|
||||
normal: {
|
||||
width: 2
|
||||
}
|
||||
},
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
showAllSymbol: true,
|
||||
color: '#F90',
|
||||
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
myChart.setOption(option);
|
||||
// echarts 窗口缩放自适应
|
||||
window.onresize = function () {
|
||||
myChart.resize();
|
||||
}
|
||||
};
|
||||
})
|
||||
</script>
|
||||
@* <div style="width:100%;height:100%;">
|
||||
<div class="layuimini-container" style="width:100%;height:100%;">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md15">
|
||||
<iframe style="width:100%;height:90vh" src="http://testpro.yaolm.top/device-bind"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@\
|
||||
<head>
|
||||
<title>webtopo-svg-edit Example</title>
|
||||
<link href="https://unpkg.com/webtopo-svg-edit@0.0.8/dist/style.css" rel="stylesheet" />
|
||||
<script src="https://unpkg.com/vue@3.2.6/dist/vue.global.prod.js"></script>
|
||||
<script src="https://unpkg.com/vue-demi@0.13.11/lib/index.iife.js"></script>
|
||||
<script src="https://unpkg.com/pinia@2.0.33/dist/pinia.iife.prod.js"></script>
|
||||
<script src="https://unpkg.com/webtopo-svg-edit@0.0.8/dist/webtopo-svg-edit.umd.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
const pinia = Pinia.createPinia()
|
||||
const app = Vue.createApp(WebtopoYLM.WebtopoSvgEdit)
|
||||
app.use(pinia)
|
||||
app.mount('#app')
|
||||
</script>
|
||||
</body>
|
Reference in New Issue
Block a user