This commit is contained in:
Kai 2021-08-23 18:36:00 +08:00
commit ebc1a02bec
8 changed files with 576 additions and 313 deletions

View File

@ -7,6 +7,12 @@ using System.Threading.Tasks;
using SolarPower.Models;
using SolarPower.Models.PowerStation;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using NPOI.XSSF.UserModel;
using NPOI.SS.UserModel;
using System.IO;
using NPOI.SS.Util;
using NPOI.SS.UserModel.Charts;
namespace SolarPower.Controllers
{
@ -46,7 +52,452 @@ namespace SolarPower.Controllers
return apiResult;
}
public FileResult ExportExcelAsync(string post)
{
var postObject = JsonConvert.DeserializeObject<SearchGeneration2>(post);
var workbook = new XSSFWorkbook();
#region excel設定
IFont font12 = workbook.CreateFont();
font12.FontName = "新細明體";
font12.FontHeightInPoints = 12;
ICellStyle style12yellow = workbook.CreateCellStyle();
style12yellow.SetFont(font12);
style12yellow.Alignment = HorizontalAlignment.Center;
style12yellow.VerticalAlignment = VerticalAlignment.Center;
style12yellow.BorderTop = BorderStyle.Thin;
style12yellow.BorderBottom = BorderStyle.Thin;
style12yellow.BorderLeft = BorderStyle.Thin;
style12yellow.BorderRight = BorderStyle.Thin;
style12yellow.FillForegroundColor = IndexedColors.Yellow.Index;
style12yellow.FillPattern = FillPattern.SolidForeground;
style12yellow.WrapText = true;
ICellStyle style12lightgreen = workbook.CreateCellStyle();
style12lightgreen.SetFont(font12);
style12lightgreen.Alignment = HorizontalAlignment.Center;
style12lightgreen.VerticalAlignment = VerticalAlignment.Center;
style12lightgreen.BorderTop = BorderStyle.Thin;
style12lightgreen.BorderBottom = BorderStyle.Thin;
style12lightgreen.BorderLeft = BorderStyle.Thin;
style12lightgreen.BorderRight = BorderStyle.Thin;
style12lightgreen.FillForegroundColor = IndexedColors.LightGreen.Index;
style12lightgreen.FillPattern = FillPattern.SolidForeground;
style12lightgreen.WrapText = true;
ICellStyle style12green = workbook.CreateCellStyle();
style12green.SetFont(font12);
style12green.Alignment = HorizontalAlignment.Center;
style12green.VerticalAlignment = VerticalAlignment.Center;
style12green.BorderTop = BorderStyle.Thin;
style12green.BorderBottom = BorderStyle.Thin;
style12green.BorderLeft = BorderStyle.Thin;
style12green.BorderRight = BorderStyle.Thin;
style12green.FillForegroundColor = IndexedColors.BrightGreen.Index;
style12green.FillPattern = FillPattern.SolidForeground;
style12green.WrapText = true;
ICellStyle style12orange = workbook.CreateCellStyle();
style12orange.SetFont(font12);
style12orange.Alignment = HorizontalAlignment.Center;
style12orange.VerticalAlignment = VerticalAlignment.Center;
style12orange.BorderTop = BorderStyle.Thin;
style12orange.BorderBottom = BorderStyle.Thin;
style12orange.BorderLeft = BorderStyle.Thin;
style12orange.BorderRight = BorderStyle.Thin;
style12orange.FillForegroundColor = IndexedColors.LightOrange.Index;
style12orange.FillPattern = FillPattern.SolidForeground;
style12orange.WrapText = true;
#endregion
foreach (var objects in postObject.PowerStation)
{
var sheet = workbook.CreateSheet(objects.Name);
SearchGeneration select_Table = new SearchGeneration
{
Date = postObject.Date,
PowerstationId = Convert.ToInt32(objects.Value),
DateType = postObject.DateType
};
var result = GetGenerationList(select_Table);
CellRangeAddress region;
IRow row ;
ICell cell ;
for(var a = 0;a<15;a++)
{
sheet.SetColumnWidth(a, 6 * 160 * 4);
}
row = sheet.CreateRow(0);
row.HeightInPoints = 40;
#region row-0
cell = row.CreateCell(0);
cell.SetCellValue(objects.Name);
region = new CellRangeAddress(0, 0, 0, 2);
sheet.AddMergedRegion(region);
cell.CellStyle = style12yellow;
cell = row.CreateCell(2);
cell.CellStyle = style12yellow;
cell = row.CreateCell(3);
cell.SetCellValue("CBA");
region = new CellRangeAddress(0, 0, 3, 5);
sheet.AddMergedRegion(region);
cell.CellStyle = style12yellow;
cell = row.CreateCell(5);
cell.CellStyle = style12yellow;
cell = row.CreateCell(6);
cell.SetCellValue("監控系統");
region = new CellRangeAddress(0, 0, 6, 7);
sheet.AddMergedRegion(region);
cell.CellStyle = style12yellow;
cell = row.CreateCell(7);
cell.CellStyle = style12yellow;
cell = row.CreateCell(8);
cell.SetCellValue("Actual Rev.");
region = new CellRangeAddress(0, 0, 8, 9);
sheet.AddMergedRegion(region);
cell.CellStyle = style12yellow;
cell = row.CreateCell(9);
cell.CellStyle = style12yellow;
cell = row.CreateCell(10);
cell.SetCellValue("平均發電度數小計\r(/kW)");
region = new CellRangeAddress(0, 0, 10, 14);
sheet.AddMergedRegion(region);
cell.CellStyle = style12yellow;
cell = row.CreateCell(14);
cell.CellStyle = style12yellow;
#endregion
row = sheet.CreateRow(1);
row.HeightInPoints = 40;
#region row-1
cell = row.CreateCell(0);
cell.SetCellValue("計算區間");
region = new CellRangeAddress(1, 2, 0, 2);
sheet.AddMergedRegion(region);
cell.CellStyle = style12green;
cell = row.CreateCell(1);
cell.CellStyle = style12green;
cell = row.CreateCell(2);
cell.CellStyle = style12green;
cell = row.CreateCell(3);
cell.SetCellValue("建置容量\r(kW)");
cell.CellStyle = style12green;
cell = row.CreateCell(4);
cell.SetCellValue("發電度數\r(/kW /日)");
cell.CellStyle = style12green;
cell = row.CreateCell(5);
cell.SetCellValue("售電單價\r(NT$/度)");
cell.CellStyle = style12green;
cell = row.CreateCell(6);
cell.SetCellValue("建置容量\r(kW)");
cell.CellStyle = style12green;
cell = row.CreateCell(7);
cell.SetCellValue("售電單價\r(NT$/度)");
cell.CellStyle = style12green;
cell = row.CreateCell(8);
cell.SetCellValue("建置容量\r(kW)");
cell.CellStyle = style12green;
cell = row.CreateCell(9);
cell.SetCellValue("建置容量\r(kW)");
cell.CellStyle = style12green;
cell = row.CreateCell(10);
cell.SetCellValue("CBA");
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(11);
cell.SetCellValue("監控系統");
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(12);
cell.SetCellValue("v.s CBA");
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(13);
cell.SetCellValue("Actual");
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(14);
cell.SetCellValue("v.s CBA");
cell.CellStyle = style12lightgreen;
#endregion
row = sheet.CreateRow(3);
row.HeightInPoints = 40;
#region row-3
cell = row.CreateCell(0);
cell.SetCellValue("起日");
cell.CellStyle = style12orange;
cell = row.CreateCell(1);
cell.SetCellValue("訖日");
cell.CellStyle = style12orange;
cell = row.CreateCell(2);
cell.SetCellValue("天數");
cell.CellStyle = style12orange;
cell = row.CreateCell(3);
cell.SetCellValue("發電效能");
cell.CellStyle = style12orange;
cell = row.CreateCell(4);
cell.SetCellValue("總發電量\r(度數)");
cell.CellStyle = style12orange;
cell = row.CreateCell(5);
cell.SetCellValue("總售電收入\r(NT$)");
cell.CellStyle = style12orange;
cell = row.CreateCell(6);
cell.SetCellValue("總發電量\r(度數)");
cell.CellStyle = style12orange;
cell = row.CreateCell(7);
cell.SetCellValue("總售電收入\r(NT$)");
cell.CellStyle = style12orange;
cell = row.CreateCell(8);
cell.SetCellValue("總發電量\r(度數)");
cell.CellStyle = style12orange;
cell = row.CreateCell(9);
cell.SetCellValue("總售電收入\r(NT$)");
cell.CellStyle = style12orange;
cell = row.CreateCell(10);
cell.SetCellValue("平均發電度數明細\r(/kW/日)");
region = new CellRangeAddress(3, 3, 10, 14);
sheet.AddMergedRegion(region);
cell.CellStyle = style12orange;
cell = row.CreateCell(14);
cell.CellStyle = style12orange;
#endregion
int index = 4;
var totalday = 0;
var totalCBA = 0.0;
var totalReal = 0.0;
var totalAct = 0.0;
var cap = 0.0;
var rate = 0.0;
var cbAkwh = 0.0;
foreach (var day in result.Result.Data)
{
totalReal += day.realKWH;
totalAct += day.actualkwh;
cap = day.capacity;
rate = day.rate;
cbAkwh = day.CBAkwh;
row = sheet.CreateRow(index);
row.HeightInPoints = 40;
#region row-4++
cell = row.CreateCell(0);
cell.SetCellValue(day.StartAt);
cell.CellStyle = style12green;
cell = row.CreateCell(1);
cell.SetCellValue(day.EndAt);
cell.CellStyle = style12green;
var forday = Convert.ToDateTime(day.EndAt).Subtract(Convert.ToDateTime(day.StartAt)).Days + 1;
totalday += forday;
cell = row.CreateCell(2);
cell.SetCellValue(forday + "天");
cell.CellStyle = style12green;
cell = row.CreateCell(3);
cell.SetCellValue(To2(day.CBAeff) + "%");
cell.CellStyle = style12green;
var cbakwh = day.CBAkwh * day.CBAeff * forday * day.capacity * 0.01;
totalCBA += cbakwh;
cell = row.CreateCell(4);
cell.SetCellValue(To2(cbakwh));
cell.CellStyle = style12green;
cell = row.CreateCell(5);
cell.SetCellValue(To2(cbakwh * day.rate));
cell.CellStyle = style12green;
cell = row.CreateCell(6);
cell.SetCellValue(To2(day.realKWH));
cell.CellStyle = style12green;
cell = row.CreateCell(7);
cell.SetCellValue(To2(day.realMoney));
cell.CellStyle = style12green;
cell = row.CreateCell(8);
cell.SetCellValue(To2(day.actualkwh));
cell.CellStyle = style12green;
cell = row.CreateCell(9);
cell.SetCellValue(To2(day.actualMoney));
cell.CellStyle = style12green;
cell = row.CreateCell(10);
var cbak = (day.capacity == 0 || forday == 0) ? 0 :(cbakwh / day.capacity / forday);
cell.SetCellValue(To2(cbak));
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(11);
var realk = (day.capacity == 0 || forday == 0) ? 0 : (day.realKWH / day.capacity / forday);
cell.SetCellValue(To2(realk));
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(12);
cell.SetCellValue( ((cbak == 0) ? 0 : To2((realk / cbak - 1)*100)) + "%");
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(13);
var actk = (day.capacity == 0 || forday == 0) ? 0 : (day.actualkwh / day.capacity / forday);
cell.SetCellValue(To2(actk));
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(14);
cell.SetCellValue( ((cbak == 0) ? 0 : To2((actk / cbak - 1)*100)) + "%");
cell.CellStyle = style12lightgreen;
#endregion
index++;
}
row = sheet.CreateRow(2);
row.HeightInPoints = 40;
#region row-2
cell = row.CreateCell(3);
cell.SetCellValue(To2(cap));
cell.CellStyle = style12green;
cell = row.CreateCell(4);
cell.SetCellValue(cbAkwh);
cell.CellStyle = style12green;
cell = row.CreateCell(5);
cell.SetCellValue(To2(rate));
cell.CellStyle = style12green;
cell = row.CreateCell(6);
cell.SetCellValue(To2(cap));
cell.CellStyle = style12green;
cell = row.CreateCell(7);
cell.SetCellValue(To2(rate));
cell.CellStyle = style12green;
cell = row.CreateCell(8);
cell.SetCellValue(To2(cap));
cell.CellStyle = style12green;
cell = row.CreateCell(9);
cell.SetCellValue(To2(rate));
cell.CellStyle = style12green;
var CBAkwh = (cap == 0|| totalday == 0)? 0 : totalCBA / cap / totalday;
cell = row.CreateCell(10);
cell.SetCellValue(To2(CBAkwh));
cell.CellStyle = style12lightgreen;
var Realkwh = (cap == 0 || totalday == 0) ? 0 : totalReal / cap / totalday;
cell = row.CreateCell(11);
cell.SetCellValue(To2(Realkwh));
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(12);
cell.SetCellValue(((CBAkwh == 0) ? 0 : To2((Realkwh / CBAkwh - 1) * 100)) + "%");
cell.CellStyle = style12lightgreen;
var Actkwh = (cap == 0 || totalday == 0) ? 0 : totalAct / cap / totalday;
cell = row.CreateCell(13);
cell.SetCellValue(To2(Actkwh));
cell.CellStyle = style12lightgreen;
cell = row.CreateCell(14);
cell.SetCellValue(((CBAkwh == 0) ? 0 : To2((Actkwh / CBAkwh -1) * 100))+"%");
cell.CellStyle = style12lightgreen;
#endregion
if(result.Result.Data.Count >0)
{
var drawing = sheet.CreateDrawingPatriarch();
IClientAnchor anchor = drawing.CreateAnchor(0, 0, 0, 0, 16, 1, 25, 9);
var chart = drawing.CreateChart(anchor);
IChartLegend legend = chart.GetOrCreateLegend();
legend.Position = LegendPosition.Bottom;
ILineChartData<double, double> data = chart.ChartDataFactory.CreateLineChartData<double, double>();
IBarChartData<double, double> data2 = chart.ChartDataFactory.CreateBarChartData<double, double>();
IChartAxis bottomAxis = chart.ChartAxisFactory.CreateCategoryAxis(AxisPosition.Bottom);
IValueAxis leftAxis = chart.ChartAxisFactory.CreateValueAxis(AxisPosition.Left);
bottomAxis.Crosses = AxisCrosses.AutoZero;
//bottomAxis.MinorTickMark = AxisTickMark.In;
leftAxis.Crosses = AxisCrosses.AutoZero;
IChartDataSource<double> xs = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(4, result.Result.Data.Count + 3, 0, 0));
IChartDataSource<double> ys1 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(4, result.Result.Data.Count + 3, 4, 4));
IChartDataSource<double> ys2 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(4, result.Result.Data.Count + 3, 6, 6));
IChartDataSource<double> ys3 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(4, result.Result.Data.Count + 3, 8, 8));
var Cba = data2.AddSeries(xs, ys1);
Cba.SetTitle("CBA預估總發電量(度數)");
var Real = data2.AddSeries(xs, ys2);
Real.SetTitle("監控系統總發電量(度數)");
var Act = data2.AddSeries(xs, ys3);
Act.SetTitle("台電售電量(度數)");
chart.Plot(data2, bottomAxis, leftAxis);
//chart.Plot(data, bottomAxis, leftAxis);
}
}
var ms = new NpoiMemoryStream
{
AllowClose = false
};
workbook.Write(ms);
ms.Flush();
ms.Seek(0, SeekOrigin.Begin);
return File(ms, "application/vnd.ms-excel", "電廠發電效能統計.xlsx");
}
public double To2 (double a)
{
var b = Math.Round(a, 2);
return b;
}
}
}
}

View File

@ -74,6 +74,13 @@ namespace SolarPower.Models
public string Date { get; set; }
public int PowerstationId { get; set; }
}
public class SearchGeneration2
{
public int DateType { get; set; }
public string Date { get; set; }
public List<Excelpowerstation> PowerStation { get; set; }
}
}

View File

@ -223,7 +223,12 @@
<div id="panel-5" class="panel">
<div class="panel-container show">
<div class="panel-content">
<div id="history-kWh-convas-div">
<canvas id="history-kWh"></canvas>
</div>
<div class="row mb-5">
<div class="col-md-12 d-flex overflow-auto justify-content-end">
<table class="table table-bordered text-center" style="width: 80.02%">
<thead>
@ -235,7 +240,7 @@
</tr>
<tr>
<th style="width: 6.66%">建置容量(kW)</th>
<th style="width: 6.66%">發電量(度數)</th>
<th style="width: 6.66%">發電度數(kW/日)</th>
<th style="width: 6.66%">售電單價(NT$/度)</th>
<th style="width: 6.66%">建置容量(kW)</th>
<th style="width: 6.66%">售電單價(NT$/度)</th>
@ -286,6 +291,7 @@
var nowpowerstation = null;//選擇電站
var selecterd_powerstationId = [];
var searchType;
var chart;
$(function () {
$('#collapse').trigger("click");
$('#firstclick').trigger("click");
@ -518,6 +524,11 @@
var totalcbAkwh = 0;
var totalactualkwh = 0;
var totalrealKWH = 0;
var cbAkwh = 0;
var listday = new Array(0);
var listcba = new Array(0);
var listactual = new Array(0);
var listreal = new Array(0);
$('#totalbody').empty();
$('#asbody').empty();
@ -536,27 +547,36 @@
var days = difference / (1000 * 3600 * 24) + 1;
totaldays += days;
capacity = val.capacity;
totalcbAkwh += val.cbAkwh;
totalcbAkwh += val.cbAkwh * val.cbAeff * days * val.capacity * 0.01;
rate = val.rate;
totalactualkwh += val.actualkwh;
totalrealKWH += val.realKWH;
cbAkwh = val.cbAkwh;
listday.push(val.startAt);
listcba.push((val.cbAkwh * val.cbAeff * days * val.capacity * 0.01).toFixed(2));
listactual.push(val.actualkwh.toFixed(2));
listreal.push(val.realKWH.toFixed(2));
str += "<tr>";
str += "<td>" + val.startAt + "</td>";
str += "<td>" + val.endAt + "</td>";
str += "<td>" + days + "天" + "</td>";
str += "<td>" + val.cbAeff + "%" + "</td>";
str += "<td>" + val.cbAkwh + "</td>";
str += "<td>" + val.rate * val.cbAkwh + "</td>";
str += "<td>" + (val.cbAkwh * val.cbAeff * days * val.capacity * 0.01).toFixed(2) + "</td>";
str += "<td>" + (val.rate * (val.cbAkwh * val.cbAeff * days * val.capacity * 0.01)).toFixed(2) + "</td>";
str += "<td>" + val.realKWH.toFixed(2) + "</td>";
str += "<td>" + val.realMoney.toFixed(2) + "</td>";
str += "<td>" + val.actualkwh.toFixed(2) + "</td>";
str += "<td>" + val.actualMoney.toFixed(2) + "</td>";
str += "<td>" + (val.cbAkwh / days / val.capacity).toFixed(2) + "</td>";
str += "<td>" + (val.realKWH / days / val.capacity).toFixed(2) + "</td>";
str += "<td>" + ((val.cbAkwh == 0) ? 0 :((val.realKWH / days / val.capacity) / (val.cbAkwh / days / val.capacity)).toFixed(2) - 1) + "%" + "</td>";
str += "<td>" + (val.actualkwh / days / val.capacity).toFixed(2) + "</td>";
str += "<td>" + ((val.cbAkwh == 0) ? 0 : ((val.actualkwh / days / val.capacity) / (val.cbAkwh / days / val.capacity)).toFixed(2) - 1) + "%" + "</td>";
var cba = val.cbAkwh * val.cbAeff * days * val.capacity * 0.01 / days / val.capacity;
str += "<td>" + cba.toFixed(2) + "</td>";
var real = val.realKWH / days / val.capacity;
str += "<td>" + real.toFixed(2) + "</td>";
str += "<td>" + ((cba == 0) ? 0 : ((real / cba - 1) * 100 ).toFixed(2)) + "%" + "</td>";
var act = val.actualkwh / days / val.capacity;
str += "<td>" + act.toFixed(2) + "</td>";
str += "<td>" + ((cba == 0) ? 0 : ((act / cba - 1) * 100 ).toFixed(2)) + "%" + "</td>";
str += "</tr>";
})
var checkvalue = false;
@ -566,30 +586,100 @@
}
var stra = "";
stra += "<tr>";
stra += "<td>" + capacity + "</td>";
stra += "<td>" + totalcbAkwh + "</td>";
stra += "<td>" + rate + "</td>";
stra += "<td>" + capacity + "</td>";
stra += "<td>" + rate + "</td>";
stra += "<td>" + capacity + "</td>";
stra += "<td>" + rate + "</td>";
stra += "<td>" + capacity.toFixed(2) + "</td>";
stra += "<td>" + cbAkwh.toFixed(2) + "</td>";
stra += "<td>" + rate.toFixed(2) + "</td>";
stra += "<td>" + capacity.toFixed(2) + "</td>";
stra += "<td>" + rate.toFixed(2) + "</td>";
stra += "<td>" + capacity.toFixed(2) + "</td>";
stra += "<td>" + rate.toFixed(2) + "</td>";
stra += "<td>" + (checkvalue ? 0 : (totalcbAkwh / totaldays / capacity).toFixed(2)) + "</td>";
stra += "<td>" + ((totaldays == 0) ? 0 : (totalrealKWH / totaldays / capacity).toFixed(2)) + "</td>";
stra += "<td>" + (checkvalue ? 0 : ((totalrealKWH / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)).toFixed(2) - 1) + "%" + "</td>";
stra += "<td>" + (checkvalue ? 0 : ((( (totalrealKWH / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2) ) + "%" + "</td>";
stra += "<td>" + ((totaldays == 0) ? 0 : (totalactualkwh / totaldays / capacity).toFixed(2)) + "</td>";
stra += "<td>" + (checkvalue ? 0 : ((totalactualkwh / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)).toFixed(2) - 1) + "%" + "</td>";
stra += "<td>" + (checkvalue ? 0 : ( (((totalactualkwh / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2) ) + "%" + "</td>";
stra += "</tr>";
$('#totalbody').append(stra);
$('#asbody').append(str);
$('#history-kWh-convas-div').empty();
$('#history-kWh-convas-div').append('<canvas id="history-kWh"></canvas>');
var ctx_history_kWh = document.getElementById('history-kWh').getContext('2d');
var myhistorykwh = new Chart(ctx_history_kWh, {
type: 'bar',
data: {
labels: listday,
datasets: [
{
type: 'line',
label: 'CBA預估總發電量(度數)',
borderColor: 'rgb(0, 0, 0)',
pointBackgroundColor: 'rgb(0, 0, 0)',
pointBorderColor: 'rgb(0, 0, 0)',
pointBorderWidth: 1,
borderWidth: 1,
pointRadius: 1,
pointHoverRadius: 1,
fill: true,
backgroundColor: 'rgb(255, 192, 0)',
data: listcba
}, {
type: 'bar',
label: '監控系統總發電量(度數)',
backgroundColor: 'rgba(68, 114, 196)',
borderWidth: 1,
data: listreal
}, {
type: 'bar',
label: '台電售電量(度數)',
backgroundColor: 'rgba(165, 165, 165)',
borderWidth: 1,
data: listactual
}]
},
options: {
title: {
display: true,
text: '電量比較'
},
legend: {
display: true,
position: 'bottom'
},
scales: {
yAxes: [{
type: 'linear',
position: 'left',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: '度數'
}
}]
}
}
});
});
}
function ExportExcel() {
var send_data = {
PowerStation: selecterd_powerstationId,
DateType: searchType,
Date: $('#DateGet').val()
}
if (send_data.PowerStation.length != 0) {
window.location = "/PowerGeneration/ExportExcel?post=" + JSON.stringify(send_data);
}
else {
toast_warning("請先選擇電站");
}
}
</script>
}

View File

@ -201,7 +201,7 @@
<input type="text" id="Inverter_Brand_modal" name="Inverter_Brand_modal" class="form-control">
</div>
<div class="form-group col-lg-6">
<label class="form-label" for="Inverter_BrandNum_modal"><span class="text-danger">*</span>廠商序號</label>
<label class="form-label" for="Inverter_BrandNum_modal">廠商序號</label>
<input type="text" id="Inverter_BrandNum_modal" name="Inverter_BrandNum_modal" class="form-control">
</div>
<div class="form-group col-lg-6">

View File

@ -468,14 +468,14 @@
</div>
<!-- app settings -->
<div class="hidden-md-down">
<a href="#" class="header-icon" data-toggle="modal" data-target=".js-modal-settings">
<a href="#" class="header-icon" data-toggle="modal" data-target=".js-modal-settings" style="display:none">
<i class="fal fa-cog"></i>
</a>
</div>
<!-- app message -->
<a href="#" class="header-icon" data-toggle="modal" data-target="">
<a href="#" class="header-icon" data-toggle="modal" data-target="" style="display:none">
<i class="fal fa-search"></i>
<span class="badge badge-icon">!</span>
</a>

View File

@ -398,7 +398,7 @@
}
$('#card_' + val.id).find('#solarName').html(statusicon + val.name);
$('#card_' + val.id).find('#weathericon')[0].setAttribute("class", 'fal fa-' + val.todayWeather + ' fa-2x');
$('#card_' + val.id).find('#Temp').html(val.todayWeatherTemp + '°C');
$('#card_' + val.id).find('#Temp').html((val.todayWeatherTemp == -99)? "": val.todayWeatherTemp + '°C');
var type = "";
switch (val.solarType) {
case 0: type = "自建躉售"; break;

View File

@ -2632,7 +2632,7 @@
}
catch (e) { }
if (!xmlhttp) {
window.alert("不能创建XMLHttpRequest对象");
window.alert("");
}
}
@ -2817,7 +2817,7 @@
var info = "<tr>";
info += "<td>" + rel.data.model + "</td>";
info += "<td>" + rel.data.brand + "</td>";
info += "<td>" + rel.data.brandNum + "</td>";
info += "<td>" + ((rel.data.brandNum == null) ? '' : rel.data.brandNum) + "</td>";
info += "</tr>";
$('#inverterInfo-Detail').empty();
$('#inverterInfo-Detail').append(info);

View File

@ -32,292 +32,7 @@
</div>
</div>
<ul id="ullist">
<li class="col-xl-3">
<div class="card border m-auto m-lg-0">
<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">
<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> 逆變器 022020001010001 (96.6kWp)</p>
<p class="card-text">4分鐘前</p>
</div>
<div class="list-group list-group-flush">
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<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"><a href="javascript:;" data-toggle="modal" data-target="#default-example-modal-center">詳細資料</a></span></p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸出功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸入功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class="d-flex">
PR
<span class="d-inline-block ml-auto">36.3%</span>
</div>
<div class="progress progress-sm mb-3">
<div class="progress-bar bg-info-400" role="progressbar" style="width: 36.3%;" aria-valuenow="36" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">日發電量</p>
<p class="mb-0">83.1</p>
<p class="mb-0">kWh</p>
</div>
</div>
</div>
</div>
<ul>
<li class="w-100 px-0">
<div class="card border m-auto m-lg-0">
<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">
<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> 逆變器 022020001010001 (96.6kWp)</p>
<p class="card-text">4分鐘前</p>
</div>
<div class="list-group list-group-flush">
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<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"><a href="javascript:;" OnClick='InverterInfoDetail()'>詳細資料</a></span></p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸出功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸入功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class="d-flex">
PR
<span class="d-inline-block ml-auto">36.3%</span>
</div>
<div class="progress progress-sm mb-3">
<div class="progress-bar bg-info-400" role="progressbar" style="width: 36.3%;" aria-valuenow="36" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">日發電量</p>
<p class="mb-0">83.1</p>
<p class="mb-0">kWh</p>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
<li class="col-xl-3">
<div class="card border m-auto m-lg-0">
<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">
<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> 逆變器 022020001010001 (96.6kWp)</p>
<p class="card-text">4分鐘前</p>
</div>
<div class="list-group list-group-flush">
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<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"><a href="javascript:;" data-toggle="modal" data-target="#default-example-modal-center">詳細資料</a></span></p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸出功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸入功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class="d-flex">
PR
<span class="d-inline-block ml-auto">36.3%</span>
</div>
<div class="progress progress-sm mb-3">
<div class="progress-bar bg-info-400" role="progressbar" style="width: 36.3%;" aria-valuenow="36" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">日發電量</p>
<p class="mb-0">83.1</p>
<p class="mb-0">kWh</p>
</div>
</div>
</div>
</div>
<ul>
<li class="w-100 px-0">
<div class="card border m-auto m-lg-0">
<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">
<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> 逆變器 022020001010001 (96.6kWp)</p>
<p class="card-text">4分鐘前</p>
</div>
<div class="list-group list-group-flush">
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<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"><a href="javascript:;" data-toggle="modal" data-target="#default-example-modal-center">詳細資料</a></span></p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸出功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸入功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class="d-flex">
PR
<span class="d-inline-block ml-auto">36.3%</span>
</div>
<div class="progress progress-sm mb-3">
<div class="progress-bar bg-info-400" role="progressbar" style="width: 36.3%;" aria-valuenow="36" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">日發電量</p>
<p class="mb-0">83.1</p>
<p class="mb-0">kWh</p>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
<li class="col-xl-3">
<div class="card border m-auto m-lg-0">
<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">
<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> 逆變器 022020001010001 (96.6kWp)</p>
<p class="card-text">4分鐘前</p>
</div>
<div class="list-group list-group-flush">
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<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"><a href="javascript:;" data-toggle="modal" data-target="#default-example-modal-center">詳細資料</a></span></p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸出功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸入功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class="d-flex">
PR
<span class="d-inline-block ml-auto">36.3%</span>
</div>
<div class="progress progress-sm mb-3">
<div class="progress-bar bg-info-400" role="progressbar" style="width: 36.3%;" aria-valuenow="36" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">日發電量</p>
<p class="mb-0">83.1</p>
<p class="mb-0">kWh</p>
</div>
</div>
</div>
</div>
</li>
<li class="col-xl-3">
<div class="card border m-auto m-lg-0">
<div class="card-body d-flex justify-content-between pb-0 px-2 bg-fusion-25">
<p class="font-weight-bold"> <i class="fal fa-ballot-check"></i> 逆變器 022020001010001 (96.6kWp)</p>
<p class="card-text">4分鐘前</p>
</div>
<div class="list-group list-group-flush">
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<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"><a href="javascript:;" data-toggle="modal" data-target="#default-example-modal-center">詳細資料</a></span></p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸出功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">輸入功率</p>
<p class="mb-0">1.7</p>
<p class="mb-0">kw</p>
</div>
</div>
<div class="list-group-item px-2 bg-info-20">
<div class="d-flex">
PR
<span class="d-inline-block ml-auto">36.3%</span>
</div>
<div class="progress progress-sm mb-3">
<div class="progress-bar bg-info-400" role="progressbar" style="width: 36.3%;" aria-valuenow="36" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="list-group-item px-2">
<div class=" d-flex justify-content-between">
<p class="mb-0">日發電量</p>
<p class="mb-0">83.1</p>
<p class="mb-0">kWh</p>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
</ul>