Former-commit-id: 6f2b69acf0d90f827c55d33f9b7d1387bd25c98e
TangShanKaiPing
wanggang 6 years ago
parent d6d131918f
commit 9a0be84b7b

@ -45,7 +45,25 @@ namespace IoTCenter.Controllers
[Authorize]
public IActionResult Index()
{
this._eventPublisher.Publish(new EntityInsertedEvent<Node>(new Node()));
//this._eventPublisher.Publish(new EntityInsertedEvent<Node>(new Node()));
var temp = this._nodeRepo.Table().Include(o => o.Devices).ThenInclude(o => o.Data).FirstOrDefault(o => o.Name == "207");
if (!temp.Devices.Any(o => o.Name == "207"))
{
temp.Devices.Add(new Device
{
Name = "²âÊÔÉ豸",
Number = "2019091602",
ProductId = this._productRepo.ReadOnlyTable().FirstOrDefault().Id,
Data = new List<Data> {
new Data{
Key="Electricity",
Value="659",
}
}
});
this._nodeRepo.SaveChanges();
}
return View();
}

@ -80,6 +80,10 @@
.btns .btn {
margin: 18px 0;
}
.ptz img, .control img {
cursor: pointer;
}
</style>
<title>@HtmlTitle | @cfg["name"]</title>
</head>

@ -23,7 +23,7 @@
<div class="col-md-12">
<canvas id="EnergyChart" style="width:100%;height:250px;"></canvas>
<div class="description-block">
<span class="description-text">总电量:{{ViewModel.EnergyChart.total}} 千瓦时</span>
<span class="description-text">总电量:{{ViewModel.EnergyChart.total.toFixed(2)}} 千瓦时</span>
</div>
</div>
</div>

@ -173,7 +173,7 @@
</div>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6 control">
<div class="box box-solid btns">
<div class="row">
<div class="col-md-4"><span style="display:inline-block;line-height:70px;">用电:</span></div>

Loading…
Cancel
Save