未有詳細資料
This commit is contained in:
parent
5abdc961a1
commit
54250e64bb
@ -5047,10 +5047,10 @@ namespace SolarPower.Repository.Implement
|
|||||||
{
|
{
|
||||||
var sql = @$"SELECT b.*,c.InverterName as INVERTERName,c.ID as ID FROM
|
var sql = @$"SELECT b.*,c.InverterName as INVERTERName,c.ID as ID FROM
|
||||||
(
|
(
|
||||||
SELECT MAX(aa.TIMESTAMP) AS maxtime ,aa.INVERTERID from (SELECT * from {site_db}.{site_table} LIMIT 500) aa GROUP BY INVERTERID
|
SELECT MAX(aa.TIMESTAMP) AS maxtime ,aa.INVERTERID from (SELECT * from {site_db}.{site_table} ORDER BY ID desc LIMIT 1000) aa GROUP BY INVERTERID
|
||||||
) a
|
) a
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(SELECT * from {site_db}.{site_table} LIMIT 500) b ON a.maxtime = b.TIMESTAMP AND a.INVERTERID = b.INVERTERID
|
(SELECT * from {site_db}.{site_table} ORDER BY ID desc LIMIT 1000) b ON a.maxtime = b.TIMESTAMP AND a.INVERTERID = b.INVERTERID
|
||||||
LEFT JOIN {site_db}.inverter c ON b.INVERTERID = c.InverterId
|
LEFT JOIN {site_db}.inverter c ON b.INVERTERID = c.InverterId
|
||||||
WHERE b.INVERTERID in @ids
|
WHERE b.INVERTERID in @ids
|
||||||
";
|
";
|
||||||
|
|||||||
@ -43,6 +43,11 @@
|
|||||||
<i class="fal fa-list-alt text-success"></i> <span class="hidden-sm-down ml-1">裝置列表</span>
|
<i class="fal fa-list-alt text-success"></i> <span class="hidden-sm-down ml-1">裝置列表</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-inverter" role="tab">
|
||||||
|
<i class="fal fa-sensor-alert text-success"></i> <span class="hidden-sm-down ml-1">逆變器監控</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-operation-firm" role="tab">
|
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-operation-firm" role="tab">
|
||||||
<i class="fal fa-hands-helping text-success"></i> <span class="hidden-sm-down ml-1">維運廠商</span>
|
<i class="fal fa-hands-helping text-success"></i> <span class="hidden-sm-down ml-1">維運廠商</span>
|
||||||
@ -58,11 +63,7 @@
|
|||||||
<i class="fal fa-sensor-alert text-success"></i> <span class="hidden-sm-down ml-1">異常設定</span>
|
<i class="fal fa-sensor-alert text-success"></i> <span class="hidden-sm-down ml-1">異常設定</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-inverter" role="tab">
|
|
||||||
<i class="fal fa-sensor-alert text-success"></i> <span class="hidden-sm-down ml-1">逆變器監控</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content p-3">
|
<div class="tab-content p-3">
|
||||||
<div class="tab-pane fade show active" id="tab-station-info" role="tabpanel" aria-labelledby="tab-station-info">
|
<div class="tab-pane fade show active" id="tab-station-info" role="tabpanel" aria-labelledby="tab-station-info">
|
||||||
@ -73,6 +74,10 @@
|
|||||||
@Html.Partial("_DeviceSetting")
|
@Html.Partial("_DeviceSetting")
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="tab-inverter" role="tabpanel" aria-labelledby="tab-inverter">
|
||||||
|
@Html.Partial("_Inverter")
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="tab-operation-firm" role="tabpanel" aria-labelledby="tab-operation-firm">
|
<div class="tab-pane fade" id="tab-operation-firm" role="tabpanel" aria-labelledby="tab-operation-firm">
|
||||||
@Html.Partial("_Operation")
|
@Html.Partial("_Operation")
|
||||||
</div>
|
</div>
|
||||||
@ -85,9 +90,7 @@
|
|||||||
@Html.Partial("_Exception")
|
@Html.Partial("_Exception")
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="tab-inverter" role="tabpanel" aria-labelledby="tab-inverter">
|
|
||||||
@Html.Partial("_Inverter")
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -897,6 +900,15 @@
|
|||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
GetInverterCard(stationId);
|
GetInverterCard(stationId);
|
||||||
|
|
||||||
|
if (typeof (Worker) !== "undefined") {
|
||||||
|
var worker = new Worker('../js/workers/workers.js');
|
||||||
|
worker.onmessage = function (event) {
|
||||||
|
if (event.data == "ok") {
|
||||||
|
GetInverterCard(stationId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//#region 代管切換
|
//#region 代管切換
|
||||||
@ -2879,8 +2891,9 @@
|
|||||||
$("#Invertercard-kwh").html(rel.data.kwh);
|
$("#Invertercard-kwh").html(rel.data.kwh);
|
||||||
$("#Invertercard-money").html(rel.data.today_Money);
|
$("#Invertercard-money").html(rel.data.today_Money);
|
||||||
$("#Invertercard-pr").html(rel.data.today_PR);
|
$("#Invertercard-pr").html(rel.data.today_PR);
|
||||||
var str = "<div class='progress progress-sm'>" +
|
var str = "<div class='progress progress-sm ' id='prbar'>" +
|
||||||
"<div class='progress-bar bg-info' role = 'progressbar' style = 'width: " + rel.data.today_PR + "%;' aria - valuenow='" + rel.data.today_PR +"' aria - valuemin='0' aria - valuemax='100' ></div > </div >"
|
"<div class='progress-bar bg-info' role = 'progressbar' style = 'width: " + rel.data.today_PR + "%;' aria - valuenow='" + rel.data.today_PR +"' aria - valuemin='0' aria - valuemax='100' ></div > </div >"
|
||||||
|
$('#prbar').remove();
|
||||||
$("#Invertercard").append(str);
|
$("#Invertercard").append(str);
|
||||||
var TypeName = "";
|
var TypeName = "";
|
||||||
switch (rel.data.solarType) {
|
switch (rel.data.solarType) {
|
||||||
@ -2924,10 +2937,10 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#ullist").empty();
|
$("#ullist").empty();
|
||||||
var long = rel.data.length <= 3 ? rel.data.length : 4;
|
var long = rel.data.length <= 4 ? rel.data.length : 4;
|
||||||
for (var a = 0; a < long; a++)
|
for (var a = 0; a < long; a++)
|
||||||
{
|
{
|
||||||
var str = "<li class='col-xl-3'>";
|
var str = "<li class='col-xl-3' id='li_" + a + "'>";
|
||||||
str += '<div class="card border m-auto m-lg-0">';
|
str += '<div class="card border m-auto m-lg-0">';
|
||||||
str += '<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">';
|
str += '<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">';
|
||||||
str += '<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> ' + rel.data[a].name + '</p>';
|
str += '<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> ' + rel.data[a].name + '</p>';
|
||||||
@ -2936,12 +2949,18 @@
|
|||||||
str += '<div class="list-group-item px-2">';
|
str += '<div class="list-group-item px-2">';
|
||||||
str += '<div class=" d-flex justify-content-between">';
|
str += '<div class=" d-flex justify-content-between">';
|
||||||
str += '<p class="mb-0">設備狀態</p>';
|
str += '<p class="mb-0">設備狀態</p>';
|
||||||
|
if (rel.data[a].type == 1) {
|
||||||
|
str += '<p class="mb-0"><span class="color-info-700 font-weight-bold">正常</span></p>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
str += '<p class="mb-0"><span class="color-info-700 font-weight-bold">異常</span></p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
str += '<p class="mb-0"><span class="color-info-700 font-weight-bold">正常</span></p>';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
str += '<p class="mb-0"><span class="color-info-700 font-weight-bold">詳細資料</span></p>';
|
str += '<p class="mb-0"><span class="color-info-700 font-weight-bold"><a href="javascript:;" OnClick="InverterInfoDetail(' + rel.data[a].id + ')">詳細資料</a></span></p>';
|
||||||
str += '</div>';
|
str += '</div>';
|
||||||
str += '</div>';
|
str += '</div>';
|
||||||
str += '<div class="list-group-item px-2 bg-info-20">';
|
str += '<div class="list-group-item px-2 bg-info-20">';
|
||||||
@ -2981,8 +3000,75 @@
|
|||||||
$("#ullist").append(str);
|
$("#ullist").append(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rel.data.length >= 4)
|
||||||
|
{
|
||||||
|
for (var a = 4; a < rel.data.length; a++)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var str = '<ul>';
|
||||||
|
str += '<div class="card border m-auto m-lg-0">';
|
||||||
|
str += '<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">';
|
||||||
|
str += '<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> ' + rel.data[a].name + '</p>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '<div class="list-group list-group-flush">';
|
||||||
|
str += '<div class="list-group-item px-2">';
|
||||||
|
str += '<div class=" d-flex justify-content-between">';
|
||||||
|
str += '<p class="mb-0">設備狀態</p>';
|
||||||
|
if (rel.data[a].type == 1) {
|
||||||
|
str += '<p class="mb-0"><span class="color-info-700 font-weight-bold">正常</span></p>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
str += '<p class="mb-0"><span class="color-info-700 font-weight-bold">異常</span></p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
str += '<p class="mb-0"><span class="color-info-700 font-weight-bold"><a href="javascript:;" OnClick="InverterInfoDetail(' + rel.data[a].id + ')">詳細資料</a></span></p>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '<div class="list-group-item px-2 bg-info-20">';
|
||||||
|
str += '<div class=" d-flex justify-content-between">';
|
||||||
|
str += '<p class="mb-0">輸出功率</p>';
|
||||||
|
str += '<p class="mb-0">' + rel.data[a].output.toFixed(2) + '</p>';
|
||||||
|
str += '<p class="mb-0">kw</p>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '<div class="list-group-item px-2">';
|
||||||
|
str += '<div class=" d-flex justify-content-between">';
|
||||||
|
str += '<p class="mb-0">輸入功率</p>';
|
||||||
|
str += '<p class="mb-0">' + rel.data[a].input.toFixed(2) + '</p>';
|
||||||
|
str += '<p class="mb-0">kw</p>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '<div class="list-group-item px-2 bg-info-20">';
|
||||||
|
str += '<div class="d-flex">';
|
||||||
|
str += 'PR <span class="d-inline-block ml-auto">' + rel.data[a].pr.toFixed(2) + '%</span>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '<div class="progress progress-sm mb-3">';
|
||||||
|
str += '<div class="progress-bar bg-info-400" role="progressbar" style="width: ' + rel.data[a].pr.toFixed(2) + '%;" aria-valuenow="' + rel.data[a].pr.toFixed(2) + '" aria-valuemin="0" aria-valuemax="100"></div>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '<div class="list-group-item px-2">';
|
||||||
|
str += '<div class=" d-flex justify-content-between">';
|
||||||
|
str += '<p class="mb-0">日發電量</p>';
|
||||||
|
str += '<p class="mb-0">' + rel.data[a].todaykwh.toFixed(2) + '</p>';
|
||||||
|
str += '<p class="mb-0">kWh</p>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '</ul>';
|
||||||
|
|
||||||
|
$("#li_" + a % 4).append(str);
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function InverterInfoDetail(id) {
|
||||||
|
$("#inverterdetailmodal").modal();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@
|
|||||||
<div class=" d-flex justify-content-between">
|
<div class=" d-flex justify-content-between">
|
||||||
<p class="mb-0">設備狀態</p>
|
<p class="mb-0">設備狀態</p>
|
||||||
<p class="mb-0"><span class="color-info-700 font-weight-bold">正常</span></p>
|
<p class="mb-0"><span class="color-info-700 font-weight-bold">正常</span></p>
|
||||||
<p class="mb-0"><span class="color-info-700 font-weight-bold"><a href="javascript:;" data-toggle="modal" data-target="#default-example-modal-center">詳細資料</a></span></p>
|
<p class="mb-0"><span class="color-info-700 font-weight-bold"><a href="javascript:;" OnClick='InverterInfoDetail()'>詳細資料</a></span></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-group-item px-2 bg-info-20">
|
<div class="list-group-item px-2 bg-info-20">
|
||||||
@ -325,7 +325,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="modal fade" id="default-example-modal-center" tabindex="-1" role="dialog" aria-hidden="true">
|
<div class="modal fade" id="inverterdetailmodal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
|||||||
@ -399,6 +399,7 @@
|
|||||||
console.log(`Sorry, we are out of ${val.solarType}.`);
|
console.log(`Sorry, we are out of ${val.solarType}.`);
|
||||||
}
|
}
|
||||||
$('#card_' + val.id).find('#editSolarUrl').find('#Solarimg').attr('src', val.mainDisplay);
|
$('#card_' + val.id).find('#editSolarUrl').find('#Solarimg').attr('src', val.mainDisplay);
|
||||||
|
$('#card_' + val.id).find('#editSolarUrl').find('#Solarimg').attr('style', "width: 100%;height: 210.5px;");
|
||||||
$('#card_' + val.id).find('#stationtype').html(type);
|
$('#card_' + val.id).find('#stationtype').html(type);
|
||||||
var time = new Date(val.createdAt);
|
var time = new Date(val.createdAt);
|
||||||
$('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id);
|
$('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id);
|
||||||
|
|||||||
10
SolarPower/wwwroot/js/workers/workers.js
Normal file
10
SolarPower/wwwroot/js/workers/workers.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
var time = true;
|
||||||
|
function timer() {
|
||||||
|
console.log("haha");
|
||||||
|
postMessage("ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (time) {
|
||||||
|
var myVar = setInterval(function () { timer() }, 300000);
|
||||||
|
time = false;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user