You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
124 lines
4.4 KiB
124 lines
4.4 KiB
@inject IRepository<Area> areaRepo
|
|
@inject IRepository<Organ> organRepo
|
|
@inject IRepository<User> userRepo
|
|
@inject IRepository<Building> buildingRepo
|
|
@{
|
|
HideBread = true;
|
|
var areas = areaRepo.ReadOnlyTable().Count(o => o.ParentId != null);
|
|
var organs = organRepo.ReadOnlyTable().Count(o => o.ParentId != null);
|
|
var users = userRepo.ReadOnlyTable().Count();
|
|
var buildings = buildingRepo.ReadOnlyTable().Count(o => o.Type == BuildingType.Building);
|
|
}
|
|
<br />
|
|
<div class="row">
|
|
<div class="col-lg-3 col-6">
|
|
<!-- small box -->
|
|
<div class="small-box bg-info">
|
|
<div class="inner">
|
|
<h3>@areas</h3>
|
|
<p>区域</p>
|
|
</div>
|
|
<div class="icon">
|
|
<i class="ion ion-earth"></i>
|
|
</div>
|
|
<a href="@Url.Action(null,"Area",new { area="Admin"})" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-3 col-6">
|
|
<div class="small-box bg-success">
|
|
<div class="inner">
|
|
<h3>@organs</h3>
|
|
|
|
<p>机构</p>
|
|
</div>
|
|
<div class="icon">
|
|
<i class="ion ion-home"></i>
|
|
</div>
|
|
<a href="@Url.Action(null,"Organ",new { area="Admin"}))" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-3 col-6">
|
|
<div class="small-box bg-warning">
|
|
<div class="inner">
|
|
<h3>@users</h3>
|
|
|
|
<p>用户</p>
|
|
</div>
|
|
<div class="icon">
|
|
<i class="ion ion-person-add"></i>
|
|
</div>
|
|
<a href="@Url.Action(null,"User",new { area="Admin"}))" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-3 col-6">
|
|
<div class="small-box bg-danger">
|
|
<div class="inner">
|
|
<h3>@buildings</h3>
|
|
|
|
<p>建筑</p>
|
|
</div>
|
|
<div class="icon">
|
|
<i class="ion ion-pie-graph"></i>
|
|
</div>
|
|
<a href="@Url.Action(null,"Building",new { area="Admin"}))" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h1>此处显示设备种类、数量的统计信息,显示定时器和触发器的统计信息,考虑按机构显示</h1>
|
|
</div>
|
|
@section scripts{
|
|
<script>
|
|
var baseUrl = '@Url.Content("~")';
|
|
var hubUrl = "@Url.Content("~")/hub?group=page";
|
|
var onMessage = null;
|
|
</script>
|
|
<script src="~/js/util.js"></script>
|
|
<script src="~/js/iot.js"></script>
|
|
<script src="~/js/message.js"></script>
|
|
<script>
|
|
var app = new Vue({
|
|
el: '#app',
|
|
data: function () {
|
|
return {
|
|
title: "产品",
|
|
url: '/api/v1/product/getProducts',
|
|
products: [],
|
|
scenes: []
|
|
};
|
|
},
|
|
mounted: function () {
|
|
connect();
|
|
this.load();
|
|
},
|
|
methods: {
|
|
load: function () {
|
|
var vm = this;
|
|
axios.post(baseUrl + '/api/v1/product/getProducts').then(function (response) {
|
|
vm.products = response.data;
|
|
});
|
|
axios.post(baseUrl + '/api/v1/Scene/GetScenes').then(function (response) {
|
|
vm.scenes = response.data;
|
|
});
|
|
}
|
|
}
|
|
});
|
|
onMessage = function (method, json, to, from) {
|
|
var item = JSON.parse(json);
|
|
if (method === 'IoTProductEntityInserted' ||
|
|
method === 'IoTProductEntityUpdated' ||
|
|
method === 'IoTProductEntityDeleted' ||
|
|
method === 'IoTDeviceEntityInserted' ||
|
|
method === 'IoTDeviceEntityDeleted') {
|
|
app.load();
|
|
}
|
|
else if (method === 'IoTSceneEntityInserted' ||
|
|
method === 'IoTSceneEntityUpdated' ||
|
|
method === 'IoTSceneEntityDeleted') {
|
|
if (item.nodeId === null) {
|
|
app.load();
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
} |