This commit is contained in:
b110212000 2022-02-11 17:31:35 +08:00
parent a9caa7d01c
commit d4e1e68552
11 changed files with 118 additions and 74 deletions

View File

@ -42,7 +42,9 @@ namespace SolarPower.Quartz.Jobs
var ExceptionList = await overviewRepository.GetEmailExceptionList(); var ExceptionList = await overviewRepository.GetEmailExceptionList();
if(ExceptionList.Count > 0 ) if(ExceptionList.Count > 0 )
{ {
var ExceptionListex = ExceptionList.Where(x => x.normalTime == "1970-01-01 08:00:00" && DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).Minutes >= ExceptionTimes).ToList(); //var a = ExceptionList.Where(x=>x.id == 39835).Select(x => (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60)).ToList();
var ExceptionListex = ExceptionList.Where(x => x.normalTime == "1970-01-01 08:00:00" && (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes).ToList();
foreach (var Exception in ExceptionListex) foreach (var Exception in ExceptionListex)

View File

@ -425,20 +425,20 @@
toast_error(rel.msg); toast_error(rel.msg);
return; return;
} }
$('#total_kwh').html(rel.data.all_kwh.toFixed(2)); $('#total_kwh').html(toThousands(rel.data.all_kwh.toFixed(2)));
$('#total_money').html(rel.data.all_money.toFixed()); $('#total_money').html(toThousands(rel.data.all_money.toFixed()));
$('#total_kwhkwp').html(rel.data.all_KWH_KWP.toFixed(2)); $('#total_kwhkwp').html(toThousands(rel.data.all_KWH_KWP.toFixed(2)));
$('#total_PR').html(rel.data.all_PR.toFixed(2)); $('#total_PR').html(toThousands(rel.data.all_PR.toFixed(2)));
$('#total_carbon').html(rel.data.all_Carbon.toFixed(2)); $('#total_carbon').html(toThousands(rel.data.all_Carbon.toFixed(2)));
$('#total_irradiance').html(rel.data.all_irradiance.toFixed(2)); $('#total_irradiance').html(toThousands(rel.data.all_irradiance.toFixed(2)));
$('#today_kwh').html(rel.data.now_kwh.toFixed(2)); $('#today_kwh').html(toThousands(rel.data.now_kwh.toFixed(2)));
$('#today_money').html(rel.data.now_money.toFixed()); $('#today_money').html(toThousands(rel.data.now_money.toFixed()));
$('#today_kwhkwp').html(rel.data.now_KWH_KWP.toFixed(2)); $('#today_kwhkwp').html(toThousands(rel.data.now_KWH_KWP.toFixed(2)));
$('#today_PR').html(rel.data.now_PR.toFixed(2)); $('#today_PR').html(toThousands(rel.data.now_PR.toFixed(2)));
$('#today_carbon').html(rel.data.now_Carbon.toFixed(2)); $('#today_carbon').html(toThousands(rel.data.now_Carbon.toFixed(2)));
$('#today_irradiance').html(rel.data.now_irradiance.toFixed(2)); $('#today_irradiance').html(toThousands(rel.data.now_irradiance.toFixed(2)));
chart(); chart();
}) })

View File

@ -397,6 +397,7 @@
if (data == null || data.length == 0) { if (data == null || data.length == 0) {
this.data = []; this.data = [];
} }
$('#Exception_Table_wrapper').show();
return data; return data;
} }
}, },
@ -409,6 +410,7 @@
//#region 改變項目 //#region 改變項目
function ChangeType(type) { function ChangeType(type) {
$('#Exception_Table_wrapper').hide();
Type = type; Type = type;
for (var i = 0; i < 2; i++) { for (var i = 0; i < 2; i++) {
var name = "button" + i; var name = "button" + i;
@ -428,6 +430,7 @@
//#region 縣市全選 //#region 縣市全選
function Allcity() { function Allcity() {
$('#Exception_Table_wrapper').hide();
var Newpowerids = new Array(0); var Newpowerids = new Array(0);
ids = []; ids = [];
$.each(Allids, function (index, val) { $.each(Allids, function (index, val) {
@ -482,6 +485,7 @@
//#region 查詢近30天 //#region 查詢近30天
function ChangeDate30() { function ChangeDate30() {
$('#Exception_Table_wrapper').hide();
var today = new Date(); var today = new Date();
var dateLimit = new Date(new Date().setDate(today.getDate() - 30)); var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
@ -498,6 +502,7 @@
//#region 電站全選 //#region 電站全選
function Allpowerstation() { function Allpowerstation() {
$('#Exception_Table_wrapper').hide();
if (AllpoweridsType) { if (AllpoweridsType) {
AllpoweridsType = false; AllpoweridsType = false;
} else { } else {
@ -520,6 +525,7 @@
//#region 選擇縣市 //#region 選擇縣市
$('#city').on("click", "button", function () { $('#city').on("click", "button", function () {
$('#Exception_Table_wrapper').hide();
var clickid = $(this).attr('id'); var clickid = $(this).attr('id');
var classid = clickid.split("_"); var classid = clickid.split("_");
var Newpowerids = new Array(0); var Newpowerids = new Array(0);
@ -572,6 +578,7 @@
//#region 選擇電站checkbox //#region 選擇電站checkbox
$('#CheckPowerStation').on("click", "input", function () { $('#CheckPowerStation').on("click", "input", function () {
$('#Exception_Table_wrapper').hide();
var clickid = $(this).attr('id'); var clickid = $(this).attr('id');
var classid = clickid.split("_"); var classid = clickid.split("_");
var job = document.getElementById(clickid); var job = document.getElementById(clickid);
@ -587,6 +594,7 @@
//#endregion //#endregion
function getPowerStationCheckBox() { function getPowerStationCheckBox() {
$('#Exception_Table_wrapper').hide();
var send_data = { var send_data = {
cityIds: ids cityIds: ids
} }

View File

@ -194,7 +194,10 @@
"columns": [{ "columns": [{
"data": "cityName" "data": "cityName"
}, { }, {
"data": "subPowerStationCount" "data": "subPowerStationCount",
"render": function (data, type, row) {
return toThousands(data);
}
}, { }, {
"data": "subTotalCapacity" "data": "subTotalCapacity"
}], }],
@ -205,7 +208,7 @@
'createdCell': function (td, cellData, rowData, row, col) { 'createdCell': function (td, cellData, rowData, row, col) {
@*$(td).append('<div class="row"></div>');*@ @*$(td).append('<div class="row"></div>');*@
cellData = cellData.toFixed(3); cellData = cellData.toFixed(3);
$(td).html(cellData); $(td).html(toThousands(cellData));
} }
}], }],
"language": { "language": {
@ -243,18 +246,18 @@
mapOverview = rel.data; mapOverview = rel.data;
$("#today_kwh").html(mapOverview.today_kwh.toFixed(2)); $("#today_kwh").html(toThousands(mapOverview.today_kwh.toFixed(2)));
$("#total_kwh").html(mapOverview.total_kwh.toFixed(2)); $("#total_kwh").html(toThousands(mapOverview.total_kwh.toFixed(2)));
$("#today_irradiance").html(mapOverview.today_irradiance.toFixed(2)); $("#today_irradiance").html(toThousands(mapOverview.today_irradiance.toFixed(2)));
$("#avg_irradiance").html(mapOverview.avg_irradiance.toFixed(2)); $("#avg_irradiance").html(toThousands(mapOverview.avg_irradiance.toFixed(2)));
$("#today_PR").html(mapOverview.today_PR.toFixed(2)); $("#today_PR").html(toThousands(mapOverview.today_PR.toFixed(2)));
$("#avg_PR").html(mapOverview.avg_PR.toFixed(2)); $("#avg_PR").html(toThousands(mapOverview.avg_PR.toFixed(2)));
$("#today_kwhkwp").html(mapOverview.today_kwhkwp.toFixed(2)); $("#today_kwhkwp").html(toThousands(mapOverview.today_kwhkwp.toFixed(2)));
$("#avg_kwhkwp").html(mapOverview.avg_kwhkwp.toFixed(2)); $("#avg_kwhkwp").html(toThousands(mapOverview.avg_kwhkwp.toFixed(2)));
$("#today_carbon").html(mapOverview.today_carbon.toFixed(2)); $("#today_carbon").html(toThousands(mapOverview.today_carbon.toFixed(2)));
$("#total_carbon").html(mapOverview.total_carbon.toFixed(2)); $("#total_carbon").html(toThousands(mapOverview.total_carbon.toFixed(2)));
$("#total_power_station_count").html(mapOverview.totalPowerStationCount); $("#total_power_station_count").html(toThousands(mapOverview.totalPowerStationCount));
$("#total_capacity").html(mapOverview.totalCapacity.toFixed(3)); $("#total_capacity").html(toThousands(mapOverview.totalCapacity.toFixed(3)));
$("#update_at").html(mapOverview.updatedAt); $("#update_at").html(mapOverview.updatedAt);
capacityTable.clear().rows.add(mapOverview.capacityDataTables).draw(); capacityTable.clear().rows.add(mapOverview.capacityDataTables).draw();

View File

@ -383,6 +383,7 @@
if (data == null || data.length == 0) { if (data == null || data.length == 0) {
this.data = []; this.data = [];
} }
$('#OperationPlan_table_wrapper').show();
return data; return data;
} }
}, },
@ -457,6 +458,7 @@
//#region 電站全選 //#region 電站全選
function Allpowerstation() { function Allpowerstation() {
$('#OperationPlan_table_wrapper').hide();
if (AllpoweridsType) { if (AllpoweridsType) {
AllpoweridsType = false; AllpoweridsType = false;
} else { } else {
@ -535,6 +537,7 @@
//#endregion //#endregion
function getPowerStationCheckBox() { function getPowerStationCheckBox() {
$('#OperationPlan_table_wrapper').hide();
var send_data = { var send_data = {
cityIds: ids cityIds: ids
} }
@ -576,6 +579,7 @@
//#region 選擇電站checkbox //#region 選擇電站checkbox
$('#CheckPowerStation').on("click", "input", function () { $('#CheckPowerStation').on("click", "input", function () {
$('#OperationPlan_table_wrapper').hide();
var clickid = $(this).attr('id'); var clickid = $(this).attr('id');
var classid = clickid.split("_"); var classid = clickid.split("_");
var job = document.getElementById(clickid); var job = document.getElementById(clickid);
@ -593,6 +597,7 @@
//#region 更改項目 //#region 更改項目
function ChangeType(Num) { function ChangeType(Num) {
$('#OperationPlan_table_wrapper').hide();
type = Num; type = Num;
OperationPlanTable.ajax.reload(); OperationPlanTable.ajax.reload();
if (Num == 9) if (Num == 9)

View File

@ -595,6 +595,7 @@
} else { } else {
realdata = this.data; realdata = this.data;
} }
$('#operation_record_table_wrapper').show();
return realdata; return realdata;
} }
}, },
@ -664,6 +665,7 @@
//#region 改變項目 //#region 改變項目
function ChangeType(type) function ChangeType(type)
{ {
$('#operation_record_table_wrapper').hide();
Type = type; Type = type;
for (var i = 0; i < 4; i++) for (var i = 0; i < 4; i++)
{ {
@ -719,6 +721,7 @@
//#region 縣市全選 //#region 縣市全選
function Allcity() { function Allcity() {
$('#operation_record_table_wrapper').hide();
var Newpowerids = new Array(0); var Newpowerids = new Array(0);
ids = []; ids = [];
$.each(Allids, function (index, val) { $.each(Allids, function (index, val) {
@ -862,6 +865,7 @@
//#region 電站全選 //#region 電站全選
function Allpowerstation() { function Allpowerstation() {
$('#operation_record_table_wrapper').hide();
if (AllpoweridsType) { if (AllpoweridsType) {
AllpoweridsType = false; AllpoweridsType = false;
} else { } else {
@ -890,6 +894,7 @@
//#region 選擇縣市 //#region 選擇縣市
$('#city').on("click", "button", function () { $('#city').on("click", "button", function () {
$('#operation_record_table_wrapper').hide();
var clickid = $(this).attr('id'); var clickid = $(this).attr('id');
var classid = clickid.split("_"); var classid = clickid.split("_");
var Newpowerids = new Array(0); var Newpowerids = new Array(0);
@ -947,6 +952,7 @@
//#region 選擇電站checkbox //#region 選擇電站checkbox
$('#CheckPowerStation').on("click", "input", function () { $('#CheckPowerStation').on("click", "input", function () {
$('#operation_record_table_wrapper').hide();
var clickid = $(this).attr('id'); var clickid = $(this).attr('id');
var classid = clickid.split("_"); var classid = clickid.split("_");
var job = document.getElementById(clickid); var job = document.getElementById(clickid);
@ -1428,6 +1434,7 @@
//#region 查詢近30天 //#region 查詢近30天
function ChangeDate30() { function ChangeDate30() {
$('#operation_record_table_wrapper').hide();
var today = new Date(); var today = new Date();
var dateLimit = new Date(new Date().setDate(today.getDate() - 30)); var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
@ -1444,6 +1451,7 @@
//#region 改狀態 //#region 改狀態
function CheckStatus(type, e) { function CheckStatus(type, e) {
$('#operation_record_table_wrapper').hide();
status = type; status = type;
if ($(".status-type").hasClass("btn-success")) { if ($(".status-type").hasClass("btn-success")) {
$(".status-type").removeClass("btn-success").addClass("btn-secondary"); $(".status-type").removeClass("btn-success").addClass("btn-secondary");
@ -1460,6 +1468,7 @@
//#endregion //#endregion
function Search() { function Search() {
$('#operation_record_table_wrapper').hide();
Searchtype = true; Searchtype = true;
AllidsType = false; AllidsType = false;
AllpoweridsType = false; AllpoweridsType = false;

View File

@ -427,15 +427,15 @@
$('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id); $('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id);
@*$('#card_' + val.id).find('#date').html(time.getMonth() + "/" + time.getDate() + " " + time.getHours() + ":" + time.getMinutes());*@ @*$('#card_' + val.id).find('#date').html(time.getMonth() + "/" + time.getDate() + " " + time.getHours() + ":" + time.getMinutes());*@
$('#card_' + val.id).find('#date').html(val.electricityMeterAt); $('#card_' + val.id).find('#date').html(val.electricityMeterAt);
$('#card_' + val.id).find('#today_kwh').html(val.today_kWh.toFixed(2)); $('#card_' + val.id).find('#today_kwh').html(toThousands(val.today_kWh.toFixed(2)));
$('#card_' + val.id).find('#Capacity').html(val.generatingCapacity.toFixed(3)); $('#card_' + val.id).find('#Capacity').html(toThousands(val.generatingCapacity.toFixed(3)));
@if (ViewBag.myUser.Role.Auths.Contains("ShowMoney")) @if (ViewBag.myUser.Role.Auths.Contains("ShowMoney"))
{ {
<text> <text>
$('#card_' + val.id).find('#PowerRate').html((val.today_Money).toFixed()); $('#card_' + val.id).find('#PowerRate').html(toThousands((val.today_Money).toFixed()));
</text> </text>
} }
$('#card_' + val.id).find('#PR').html(val.today_PR); $('#card_' + val.id).find('#PR').html(toThousands(val.today_PR));
$('#card_' + val.id).find('#aria').attr('aria-valuenow', val.today_PR); $('#card_' + val.id).find('#aria').attr('aria-valuenow', val.today_PR);
$('#card_' + val.id).find('#aria').attr('style', "width:" + val.today_PR + "%;"); $('#card_' + val.id).find('#aria').attr('style', "width:" + val.today_PR + "%;");
powerids.push(val.id); powerids.push(val.id);
@ -505,16 +505,16 @@
$("#update_at").html(mapOverview.updatedAt); $("#update_at").html(mapOverview.updatedAt);
});*@ });*@
$("#today_kwh").html(powerStationSummary.today_kwh.toFixed(2)); $("#today_kwh").html(toThousands(powerStationSummary.today_kwh.toFixed(2)));
$("#total_kwh").html(powerStationSummary.total_kwh.toFixed(2)); $("#total_kwh").html(toThousands(powerStationSummary.total_kwh.toFixed(2)));
$("#today_irradiance").html(powerStationSummary.today_irradiance.toFixed(2)); $("#today_irradiance").html(toThousands(powerStationSummary.today_irradiance.toFixed(2)));
$("#avg_irradiance").html(powerStationSummary.avg_irradiance.toFixed(2)); $("#avg_irradiance").html(toThousands(powerStationSummary.avg_irradiance.toFixed(2)));
$("#today_PR").html(powerStationSummary.today_PR.toFixed(2)); $("#today_PR").html(toThousands(powerStationSummary.today_PR.toFixed(2)));
$("#avg_PR").html(powerStationSummary.avg_PR.toFixed(2)); $("#avg_PR").html(toThousands(powerStationSummary.avg_PR.toFixed(2)));
$("#today_kwhkwp").html(powerStationSummary.today_kwhkwp.toFixed(2)); $("#today_kwhkwp").html(toThousands(powerStationSummary.today_kwhkwp.toFixed(2)));
$("#avg_kwhkwp").html(powerStationSummary.avg_kwhkwp.toFixed(2)); $("#avg_kwhkwp").html(toThousands(powerStationSummary.avg_kwhkwp.toFixed(2)));
$("#today_carbon").html(powerStationSummary.today_carbon.toFixed(2)); $("#today_carbon").html(toThousands(powerStationSummary.today_carbon.toFixed(2)));
$("#total_carbon").html(powerStationSummary.total_carbon.toFixed(2)); $("#total_carbon").html(toThousands(powerStationSummary.total_carbon.toFixed(2)));
$("#update_at").html(powerStationSummary.updatedAt); $("#update_at").html(powerStationSummary.updatedAt);
} }

View File

@ -215,18 +215,18 @@
} }
stationOverview = rel.data; stationOverview = rel.data;
$("#today_kwh").html(stationOverview.today_kwh.toFixed(2)); $("#today_kwh").html(toThousands(stationOverview.today_kwh.toFixed(2)));
$("#total_kwh").html(stationOverview.total_kwh.toFixed(2)); $("#total_kwh").html(toThousands(stationOverview.total_kwh.toFixed(2)));
$("#today_irradiance").html(stationOverview.today_irradiance.toFixed(2)); $("#today_irradiance").html(toThousands(stationOverview.today_irradiance.toFixed(2)));
$("#avg_irradiance").html(stationOverview.avg_irradiance.toFixed(2)); $("#avg_irradiance").html(toThousands(stationOverview.avg_irradiance.toFixed(2)));
$("#today_PR").html(stationOverview.today_PR.toFixed(2)); $("#today_PR").html(toThousands(stationOverview.today_PR.toFixed(2)));
$("#avg_PR").html(stationOverview.avg_PR.toFixed(2)); $("#avg_PR").html(toThousands(stationOverview.avg_PR.toFixed(2)));
$("#today_kwhkwp").html(stationOverview.today_kwhkwp.toFixed(2)); $("#today_kwhkwp").html(toThousands(stationOverview.today_kwhkwp.toFixed(2)));
$("#avg_kwhkwp").html(stationOverview.avg_kwhkwp.toFixed(2)); $("#avg_kwhkwp").html(toThousands(stationOverview.avg_kwhkwp.toFixed(2)));
$("#total_money").html(stationOverview.total_money.toFixed()); $("#total_money").html(toThousands(stationOverview.total_money.toFixed()));
$("#today_money").html(stationOverview.today_money.toFixed()); $("#today_money").html(toThousands(stationOverview.today_money.toFixed()));
$("#today_carbon").html(stationOverview.today_carbon.toFixed(2)); $("#today_carbon").html(toThousands(stationOverview.today_carbon.toFixed(2)));
$("#total_carbon").html(stationOverview.total_carbon.toFixed(2)); $("#total_carbon").html(toThousands(stationOverview.total_carbon.toFixed(2)));
$("#update_at").html(stationOverview.updatedAt); $("#update_at").html(stationOverview.updatedAt);
var statusicon; var statusicon;
@ -913,7 +913,7 @@
if (data == null || data.length == 0) { if (data == null || data.length == 0) {
this.data = []; this.data = [];
} }
$('#operation_record_table_wrapper').show();
return data; return data;
} }
}, },
@ -1112,6 +1112,7 @@
if (data == null || data.length == 0) { if (data == null || data.length == 0) {
this.data = []; this.data = [];
} }
$("#Exception_Table_wrapper").show();
return data; return data;
} }
}, },
@ -1361,6 +1362,7 @@
//#region 查詢近30天(異常) //#region 查詢近30天(異常)
function ChangeDate30exception() { function ChangeDate30exception() {
$("#Exception_Table_wrapper").hide();
var today = new Date(); var today = new Date();
var dateLimit = new Date(new Date().setDate(today.getDate() - 30)); var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
@ -1471,6 +1473,7 @@
//#region 改變異常紀錄狀態 //#region 改變異常紀錄狀態
function ChangeStatus(type) { function ChangeStatus(type) {
$("#Exception_Table_wrapper").hide();
err_status = type; err_status = type;
var name; var name;
var name2; var name2;
@ -1484,6 +1487,7 @@
document.getElementById(name).setAttribute("class", "btn btn-success waves-effect waves-themed"); document.getElementById(name).setAttribute("class", "btn btn-success waves-effect waves-themed");
document.getElementById(name2).setAttribute("class", "btn btn-secondary waves-effect waves-themed"); document.getElementById(name2).setAttribute("class", "btn btn-secondary waves-effect waves-themed");
ExceptionTable.ajax.reload(); ExceptionTable.ajax.reload();
} }
//#endregion //#endregion
@ -1605,6 +1609,7 @@
//#region 查詢近30天(運維) //#region 查詢近30天(運維)
function ChangeDate30() { function ChangeDate30() {
$('#operation_record_table_wrapper').hide();
var today = new Date(); var today = new Date();
var dateLimit = new Date(new Date().setDate(today.getDate() - 30)); var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
@ -1788,6 +1793,7 @@
//#region 改變項目(運維) //#region 改變項目(運維)
function ChangeType(type) { function ChangeType(type) {
$('#operation_record_table_wrapper').hide();
Type = type; Type = type;
for (var i = 0; i < 4; i++) { for (var i = 0; i < 4; i++) {
var name = "button" + i; var name = "button" + i;
@ -2038,7 +2044,7 @@
//#region 載入逆便器分析HeatMap資料 //#region 載入逆便器分析HeatMap資料
function LoadInvertAnalysisHeatMap() { function LoadInvertAnalysisHeatMap() {
$('#InverterResult').attr("style", "display:none !important;");
var checkInverts = $("input[name='selectedInvert[]']:checked").map(function () { var checkInverts = $("input[name='selectedInvert[]']:checked").map(function () {
return $(this).val(); return $(this).val();
}).get(); }).get();
@ -2125,6 +2131,8 @@
series: myseries, series: myseries,
}); });
$('#InverterResult').removeAttr("style", "display:none !important;");
}, 'json'); }, 'json');
//#endregion //#endregion
@ -2202,6 +2210,8 @@
} }
function LoadInvertAnalysiskwhBar() { function LoadInvertAnalysiskwhBar() {
$('#inverter-kWh-convas-div').hide();
var url = "/StationOverview/GetInverterkwhBarAnalysis"; var url = "/StationOverview/GetInverterkwhBarAnalysis";
var send_data = { var send_data = {
PowerStationId: stationId, PowerStationId: stationId,
@ -2264,6 +2274,8 @@
}); });
//#endregion //#endregion
$('#inverter-kWh-convas-div').show();
}, 'json'); }, 'json');
} }

View File

@ -22,7 +22,7 @@
<button type="button" class="btn btn-success waves-effect waves-themed" onclick="LoadInvertAnalysisHeatMap()">查詢</button> <button type="button" class="btn btn-success waves-effect waves-themed" onclick="LoadInvertAnalysisHeatMap()">查詢</button>
</div> </div>
</div> </div>
<div class="row mb-5 d-flex justify-content-start"> <div class="row mb-5 d-flex justify-content-start" id="InverterResult">
<div class="col-12"> <div class="col-12">
<figure class="highcharts-figure"> <figure class="highcharts-figure">
<div id="container"></div> <div id="container"></div>

View File

@ -1456,22 +1456,6 @@
return hirerate; return hirerate;
} }
function toThousands(num) {
var num = (num || 0).toString(), result = '';
var last = "";
if (num.indexOf('.') != -1) {
var nn = num.split('.');
num = nn[0];
last = "." + nn[1];
}
while (num.length > 3) {
result = ',' + num.slice(-3) + result;
num = num.slice(0, num.length - 3);
}
if (num) { result = num + result + last; }
return result;
}
</script> </script>
} }

View File

@ -153,3 +153,24 @@ function ChangePassword() {
} }
} }
//#endregion //#endregion
//#region 千分位
function toThousands(num) {
var num = (num || 0).toString(), result = '';
var last = "";
if (num.indexOf('.') != -1) {
var nn = num.split('.');
num = nn[0];
last = "." + nn[1];
}
while (num.length > 3) {
result = ',' + num.slice(-3) + result;
num = num.slice(0, num.length - 3);
}
if (num) { result = num + result + last; }
return result;
}
//#endregion