優化
This commit is contained in:
parent
a9caa7d01c
commit
d4e1e68552
@ -42,7 +42,9 @@ namespace SolarPower.Quartz.Jobs
|
||||
var ExceptionList = await overviewRepository.GetEmailExceptionList();
|
||||
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)
|
||||
|
||||
@ -425,20 +425,20 @@
|
||||
toast_error(rel.msg);
|
||||
return;
|
||||
}
|
||||
$('#total_kwh').html(rel.data.all_kwh.toFixed(2));
|
||||
$('#total_money').html(rel.data.all_money.toFixed());
|
||||
$('#total_kwhkwp').html(rel.data.all_KWH_KWP.toFixed(2));
|
||||
$('#total_PR').html(rel.data.all_PR.toFixed(2));
|
||||
$('#total_carbon').html(rel.data.all_Carbon.toFixed(2));
|
||||
$('#total_irradiance').html(rel.data.all_irradiance.toFixed(2));
|
||||
$('#total_kwh').html(toThousands(rel.data.all_kwh.toFixed(2)));
|
||||
$('#total_money').html(toThousands(rel.data.all_money.toFixed()));
|
||||
$('#total_kwhkwp').html(toThousands(rel.data.all_KWH_KWP.toFixed(2)));
|
||||
$('#total_PR').html(toThousands(rel.data.all_PR.toFixed(2)));
|
||||
$('#total_carbon').html(toThousands(rel.data.all_Carbon.toFixed(2)));
|
||||
$('#total_irradiance').html(toThousands(rel.data.all_irradiance.toFixed(2)));
|
||||
|
||||
|
||||
$('#today_kwh').html(rel.data.now_kwh.toFixed(2));
|
||||
$('#today_money').html(rel.data.now_money.toFixed());
|
||||
$('#today_kwhkwp').html(rel.data.now_KWH_KWP.toFixed(2));
|
||||
$('#today_PR').html(rel.data.now_PR.toFixed(2));
|
||||
$('#today_carbon').html(rel.data.now_Carbon.toFixed(2));
|
||||
$('#today_irradiance').html(rel.data.now_irradiance.toFixed(2));
|
||||
$('#today_kwh').html(toThousands(rel.data.now_kwh.toFixed(2)));
|
||||
$('#today_money').html(toThousands(rel.data.now_money.toFixed()));
|
||||
$('#today_kwhkwp').html(toThousands(rel.data.now_KWH_KWP.toFixed(2)));
|
||||
$('#today_PR').html(toThousands(rel.data.now_PR.toFixed(2)));
|
||||
$('#today_carbon').html(toThousands(rel.data.now_Carbon.toFixed(2)));
|
||||
$('#today_irradiance').html(toThousands(rel.data.now_irradiance.toFixed(2)));
|
||||
chart();
|
||||
})
|
||||
|
||||
|
||||
@ -397,6 +397,7 @@
|
||||
if (data == null || data.length == 0) {
|
||||
this.data = [];
|
||||
}
|
||||
$('#Exception_Table_wrapper').show();
|
||||
return data;
|
||||
}
|
||||
},
|
||||
@ -409,6 +410,7 @@
|
||||
|
||||
//#region 改變項目
|
||||
function ChangeType(type) {
|
||||
$('#Exception_Table_wrapper').hide();
|
||||
Type = type;
|
||||
for (var i = 0; i < 2; i++) {
|
||||
var name = "button" + i;
|
||||
@ -428,6 +430,7 @@
|
||||
|
||||
//#region 縣市全選
|
||||
function Allcity() {
|
||||
$('#Exception_Table_wrapper').hide();
|
||||
var Newpowerids = new Array(0);
|
||||
ids = [];
|
||||
$.each(Allids, function (index, val) {
|
||||
@ -482,6 +485,7 @@
|
||||
|
||||
//#region 查詢近30天
|
||||
function ChangeDate30() {
|
||||
$('#Exception_Table_wrapper').hide();
|
||||
var today = new Date();
|
||||
var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
|
||||
|
||||
@ -498,6 +502,7 @@
|
||||
|
||||
//#region 電站全選
|
||||
function Allpowerstation() {
|
||||
$('#Exception_Table_wrapper').hide();
|
||||
if (AllpoweridsType) {
|
||||
AllpoweridsType = false;
|
||||
} else {
|
||||
@ -520,6 +525,7 @@
|
||||
|
||||
//#region 選擇縣市
|
||||
$('#city').on("click", "button", function () {
|
||||
$('#Exception_Table_wrapper').hide();
|
||||
var clickid = $(this).attr('id');
|
||||
var classid = clickid.split("_");
|
||||
var Newpowerids = new Array(0);
|
||||
@ -572,6 +578,7 @@
|
||||
|
||||
//#region 選擇電站checkbox
|
||||
$('#CheckPowerStation').on("click", "input", function () {
|
||||
$('#Exception_Table_wrapper').hide();
|
||||
var clickid = $(this).attr('id');
|
||||
var classid = clickid.split("_");
|
||||
var job = document.getElementById(clickid);
|
||||
@ -587,6 +594,7 @@
|
||||
//#endregion
|
||||
|
||||
function getPowerStationCheckBox() {
|
||||
$('#Exception_Table_wrapper').hide();
|
||||
var send_data = {
|
||||
cityIds: ids
|
||||
}
|
||||
|
||||
@ -194,9 +194,12 @@
|
||||
"columns": [{
|
||||
"data": "cityName"
|
||||
}, {
|
||||
"data": "subPowerStationCount"
|
||||
"data": "subPowerStationCount",
|
||||
"render": function (data, type, row) {
|
||||
return toThousands(data);
|
||||
}
|
||||
}, {
|
||||
"data": "subTotalCapacity"
|
||||
"data": "subTotalCapacity"
|
||||
}],
|
||||
"columnDefs": [{
|
||||
'targets': 2,
|
||||
@ -205,7 +208,7 @@
|
||||
'createdCell': function (td, cellData, rowData, row, col) {
|
||||
@*$(td).append('<div class="row"></div>');*@
|
||||
cellData = cellData.toFixed(3);
|
||||
$(td).html(cellData);
|
||||
$(td).html(toThousands(cellData));
|
||||
}
|
||||
}],
|
||||
"language": {
|
||||
@ -243,18 +246,18 @@
|
||||
|
||||
mapOverview = rel.data;
|
||||
|
||||
$("#today_kwh").html(mapOverview.today_kwh.toFixed(2));
|
||||
$("#total_kwh").html(mapOverview.total_kwh.toFixed(2));
|
||||
$("#today_irradiance").html(mapOverview.today_irradiance.toFixed(2));
|
||||
$("#avg_irradiance").html(mapOverview.avg_irradiance.toFixed(2));
|
||||
$("#today_PR").html(mapOverview.today_PR.toFixed(2));
|
||||
$("#avg_PR").html(mapOverview.avg_PR.toFixed(2));
|
||||
$("#today_kwhkwp").html(mapOverview.today_kwhkwp.toFixed(2));
|
||||
$("#avg_kwhkwp").html(mapOverview.avg_kwhkwp.toFixed(2));
|
||||
$("#today_carbon").html(mapOverview.today_carbon.toFixed(2));
|
||||
$("#total_carbon").html(mapOverview.total_carbon.toFixed(2));
|
||||
$("#total_power_station_count").html(mapOverview.totalPowerStationCount);
|
||||
$("#total_capacity").html(mapOverview.totalCapacity.toFixed(3));
|
||||
$("#today_kwh").html(toThousands(mapOverview.today_kwh.toFixed(2)));
|
||||
$("#total_kwh").html(toThousands(mapOverview.total_kwh.toFixed(2)));
|
||||
$("#today_irradiance").html(toThousands(mapOverview.today_irradiance.toFixed(2)));
|
||||
$("#avg_irradiance").html(toThousands(mapOverview.avg_irradiance.toFixed(2)));
|
||||
$("#today_PR").html(toThousands(mapOverview.today_PR.toFixed(2)));
|
||||
$("#avg_PR").html(toThousands(mapOverview.avg_PR.toFixed(2)));
|
||||
$("#today_kwhkwp").html(toThousands(mapOverview.today_kwhkwp.toFixed(2)));
|
||||
$("#avg_kwhkwp").html(toThousands(mapOverview.avg_kwhkwp.toFixed(2)));
|
||||
$("#today_carbon").html(toThousands(mapOverview.today_carbon.toFixed(2)));
|
||||
$("#total_carbon").html(toThousands(mapOverview.total_carbon.toFixed(2)));
|
||||
$("#total_power_station_count").html(toThousands(mapOverview.totalPowerStationCount));
|
||||
$("#total_capacity").html(toThousands(mapOverview.totalCapacity.toFixed(3)));
|
||||
$("#update_at").html(mapOverview.updatedAt);
|
||||
|
||||
capacityTable.clear().rows.add(mapOverview.capacityDataTables).draw();
|
||||
|
||||
@ -383,6 +383,7 @@
|
||||
if (data == null || data.length == 0) {
|
||||
this.data = [];
|
||||
}
|
||||
$('#OperationPlan_table_wrapper').show();
|
||||
return data;
|
||||
}
|
||||
},
|
||||
@ -457,6 +458,7 @@
|
||||
|
||||
//#region 電站全選
|
||||
function Allpowerstation() {
|
||||
$('#OperationPlan_table_wrapper').hide();
|
||||
if (AllpoweridsType) {
|
||||
AllpoweridsType = false;
|
||||
} else {
|
||||
@ -535,6 +537,7 @@
|
||||
//#endregion
|
||||
|
||||
function getPowerStationCheckBox() {
|
||||
$('#OperationPlan_table_wrapper').hide();
|
||||
var send_data = {
|
||||
cityIds: ids
|
||||
}
|
||||
@ -576,6 +579,7 @@
|
||||
|
||||
//#region 選擇電站checkbox
|
||||
$('#CheckPowerStation').on("click", "input", function () {
|
||||
$('#OperationPlan_table_wrapper').hide();
|
||||
var clickid = $(this).attr('id');
|
||||
var classid = clickid.split("_");
|
||||
var job = document.getElementById(clickid);
|
||||
@ -593,6 +597,7 @@
|
||||
|
||||
//#region 更改項目
|
||||
function ChangeType(Num) {
|
||||
$('#OperationPlan_table_wrapper').hide();
|
||||
type = Num;
|
||||
OperationPlanTable.ajax.reload();
|
||||
if (Num == 9)
|
||||
|
||||
@ -595,6 +595,7 @@
|
||||
} else {
|
||||
realdata = this.data;
|
||||
}
|
||||
$('#operation_record_table_wrapper').show();
|
||||
return realdata;
|
||||
}
|
||||
},
|
||||
@ -664,6 +665,7 @@
|
||||
//#region 改變項目
|
||||
function ChangeType(type)
|
||||
{
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
Type = type;
|
||||
for (var i = 0; i < 4; i++)
|
||||
{
|
||||
@ -719,6 +721,7 @@
|
||||
|
||||
//#region 縣市全選
|
||||
function Allcity() {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
var Newpowerids = new Array(0);
|
||||
ids = [];
|
||||
$.each(Allids, function (index, val) {
|
||||
@ -862,6 +865,7 @@
|
||||
|
||||
//#region 電站全選
|
||||
function Allpowerstation() {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
if (AllpoweridsType) {
|
||||
AllpoweridsType = false;
|
||||
} else {
|
||||
@ -890,6 +894,7 @@
|
||||
|
||||
//#region 選擇縣市
|
||||
$('#city').on("click", "button", function () {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
var clickid = $(this).attr('id');
|
||||
var classid = clickid.split("_");
|
||||
var Newpowerids = new Array(0);
|
||||
@ -947,6 +952,7 @@
|
||||
|
||||
//#region 選擇電站checkbox
|
||||
$('#CheckPowerStation').on("click", "input", function () {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
var clickid = $(this).attr('id');
|
||||
var classid = clickid.split("_");
|
||||
var job = document.getElementById(clickid);
|
||||
@ -1428,6 +1434,7 @@
|
||||
|
||||
//#region 查詢近30天
|
||||
function ChangeDate30() {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
var today = new Date();
|
||||
var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
|
||||
|
||||
@ -1444,6 +1451,7 @@
|
||||
|
||||
//#region 改狀態
|
||||
function CheckStatus(type, e) {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
status = type;
|
||||
if ($(".status-type").hasClass("btn-success")) {
|
||||
$(".status-type").removeClass("btn-success").addClass("btn-secondary");
|
||||
@ -1460,6 +1468,7 @@
|
||||
//#endregion
|
||||
|
||||
function Search() {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
Searchtype = true;
|
||||
AllidsType = false;
|
||||
AllpoweridsType = false;
|
||||
|
||||
@ -427,15 +427,15 @@
|
||||
$('#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(val.electricityMeterAt);
|
||||
$('#card_' + val.id).find('#today_kwh').html(val.today_kWh.toFixed(2));
|
||||
$('#card_' + val.id).find('#Capacity').html(val.generatingCapacity.toFixed(3));
|
||||
$('#card_' + val.id).find('#today_kwh').html(toThousands(val.today_kWh.toFixed(2)));
|
||||
$('#card_' + val.id).find('#Capacity').html(toThousands(val.generatingCapacity.toFixed(3)));
|
||||
@if (ViewBag.myUser.Role.Auths.Contains("ShowMoney"))
|
||||
{
|
||||
<text>
|
||||
$('#card_' + val.id).find('#PowerRate').html((val.today_Money).toFixed());
|
||||
$('#card_' + val.id).find('#PowerRate').html(toThousands((val.today_Money).toFixed()));
|
||||
</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('style', "width:" + val.today_PR + "%;");
|
||||
powerids.push(val.id);
|
||||
@ -505,16 +505,16 @@
|
||||
$("#update_at").html(mapOverview.updatedAt);
|
||||
});*@
|
||||
|
||||
$("#today_kwh").html(powerStationSummary.today_kwh.toFixed(2));
|
||||
$("#total_kwh").html(powerStationSummary.total_kwh.toFixed(2));
|
||||
$("#today_irradiance").html(powerStationSummary.today_irradiance.toFixed(2));
|
||||
$("#avg_irradiance").html(powerStationSummary.avg_irradiance.toFixed(2));
|
||||
$("#today_PR").html(powerStationSummary.today_PR.toFixed(2));
|
||||
$("#avg_PR").html(powerStationSummary.avg_PR.toFixed(2));
|
||||
$("#today_kwhkwp").html(powerStationSummary.today_kwhkwp.toFixed(2));
|
||||
$("#avg_kwhkwp").html(powerStationSummary.avg_kwhkwp.toFixed(2));
|
||||
$("#today_carbon").html(powerStationSummary.today_carbon.toFixed(2));
|
||||
$("#total_carbon").html(powerStationSummary.total_carbon.toFixed(2));
|
||||
$("#today_kwh").html(toThousands(powerStationSummary.today_kwh.toFixed(2)));
|
||||
$("#total_kwh").html(toThousands(powerStationSummary.total_kwh.toFixed(2)));
|
||||
$("#today_irradiance").html(toThousands(powerStationSummary.today_irradiance.toFixed(2)));
|
||||
$("#avg_irradiance").html(toThousands(powerStationSummary.avg_irradiance.toFixed(2)));
|
||||
$("#today_PR").html(toThousands(powerStationSummary.today_PR.toFixed(2)));
|
||||
$("#avg_PR").html(toThousands(powerStationSummary.avg_PR.toFixed(2)));
|
||||
$("#today_kwhkwp").html(toThousands(powerStationSummary.today_kwhkwp.toFixed(2)));
|
||||
$("#avg_kwhkwp").html(toThousands(powerStationSummary.avg_kwhkwp.toFixed(2)));
|
||||
$("#today_carbon").html(toThousands(powerStationSummary.today_carbon.toFixed(2)));
|
||||
$("#total_carbon").html(toThousands(powerStationSummary.total_carbon.toFixed(2)));
|
||||
$("#update_at").html(powerStationSummary.updatedAt);
|
||||
}
|
||||
|
||||
|
||||
@ -215,18 +215,18 @@
|
||||
}
|
||||
|
||||
stationOverview = rel.data;
|
||||
$("#today_kwh").html(stationOverview.today_kwh.toFixed(2));
|
||||
$("#total_kwh").html(stationOverview.total_kwh.toFixed(2));
|
||||
$("#today_irradiance").html(stationOverview.today_irradiance.toFixed(2));
|
||||
$("#avg_irradiance").html(stationOverview.avg_irradiance.toFixed(2));
|
||||
$("#today_PR").html(stationOverview.today_PR.toFixed(2));
|
||||
$("#avg_PR").html(stationOverview.avg_PR.toFixed(2));
|
||||
$("#today_kwhkwp").html(stationOverview.today_kwhkwp.toFixed(2));
|
||||
$("#avg_kwhkwp").html(stationOverview.avg_kwhkwp.toFixed(2));
|
||||
$("#total_money").html(stationOverview.total_money.toFixed());
|
||||
$("#today_money").html(stationOverview.today_money.toFixed());
|
||||
$("#today_carbon").html(stationOverview.today_carbon.toFixed(2));
|
||||
$("#total_carbon").html(stationOverview.total_carbon.toFixed(2));
|
||||
$("#today_kwh").html(toThousands(stationOverview.today_kwh.toFixed(2)));
|
||||
$("#total_kwh").html(toThousands(stationOverview.total_kwh.toFixed(2)));
|
||||
$("#today_irradiance").html(toThousands(stationOverview.today_irradiance.toFixed(2)));
|
||||
$("#avg_irradiance").html(toThousands(stationOverview.avg_irradiance.toFixed(2)));
|
||||
$("#today_PR").html(toThousands(stationOverview.today_PR.toFixed(2)));
|
||||
$("#avg_PR").html(toThousands(stationOverview.avg_PR.toFixed(2)));
|
||||
$("#today_kwhkwp").html(toThousands(stationOverview.today_kwhkwp.toFixed(2)));
|
||||
$("#avg_kwhkwp").html(toThousands(stationOverview.avg_kwhkwp.toFixed(2)));
|
||||
$("#total_money").html(toThousands(stationOverview.total_money.toFixed()));
|
||||
$("#today_money").html(toThousands(stationOverview.today_money.toFixed()));
|
||||
$("#today_carbon").html(toThousands(stationOverview.today_carbon.toFixed(2)));
|
||||
$("#total_carbon").html(toThousands(stationOverview.total_carbon.toFixed(2)));
|
||||
$("#update_at").html(stationOverview.updatedAt);
|
||||
|
||||
var statusicon;
|
||||
@ -913,7 +913,7 @@
|
||||
if (data == null || data.length == 0) {
|
||||
this.data = [];
|
||||
}
|
||||
|
||||
$('#operation_record_table_wrapper').show();
|
||||
return data;
|
||||
}
|
||||
},
|
||||
@ -1112,6 +1112,7 @@
|
||||
if (data == null || data.length == 0) {
|
||||
this.data = [];
|
||||
}
|
||||
$("#Exception_Table_wrapper").show();
|
||||
return data;
|
||||
}
|
||||
},
|
||||
@ -1361,6 +1362,7 @@
|
||||
|
||||
//#region 查詢近30天(異常)
|
||||
function ChangeDate30exception() {
|
||||
$("#Exception_Table_wrapper").hide();
|
||||
var today = new Date();
|
||||
var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
|
||||
|
||||
@ -1471,6 +1473,7 @@
|
||||
|
||||
//#region 改變異常紀錄狀態
|
||||
function ChangeStatus(type) {
|
||||
$("#Exception_Table_wrapper").hide();
|
||||
err_status = type;
|
||||
var name;
|
||||
var name2;
|
||||
@ -1484,6 +1487,7 @@
|
||||
document.getElementById(name).setAttribute("class", "btn btn-success waves-effect waves-themed");
|
||||
document.getElementById(name2).setAttribute("class", "btn btn-secondary waves-effect waves-themed");
|
||||
ExceptionTable.ajax.reload();
|
||||
|
||||
}
|
||||
//#endregion
|
||||
|
||||
@ -1605,6 +1609,7 @@
|
||||
|
||||
//#region 查詢近30天(運維)
|
||||
function ChangeDate30() {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
var today = new Date();
|
||||
var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
|
||||
|
||||
@ -1788,6 +1793,7 @@
|
||||
|
||||
//#region 改變項目(運維)
|
||||
function ChangeType(type) {
|
||||
$('#operation_record_table_wrapper').hide();
|
||||
Type = type;
|
||||
for (var i = 0; i < 4; i++) {
|
||||
var name = "button" + i;
|
||||
@ -2038,7 +2044,7 @@
|
||||
|
||||
//#region 載入逆便器分析HeatMap資料
|
||||
function LoadInvertAnalysisHeatMap() {
|
||||
|
||||
$('#InverterResult').attr("style", "display:none !important;");
|
||||
var checkInverts = $("input[name='selectedInvert[]']:checked").map(function () {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
@ -2125,6 +2131,8 @@
|
||||
|
||||
series: myseries,
|
||||
});
|
||||
|
||||
$('#InverterResult').removeAttr("style", "display:none !important;");
|
||||
}, 'json');
|
||||
//#endregion
|
||||
|
||||
@ -2202,6 +2210,8 @@
|
||||
}
|
||||
|
||||
function LoadInvertAnalysiskwhBar() {
|
||||
$('#inverter-kWh-convas-div').hide();
|
||||
|
||||
var url = "/StationOverview/GetInverterkwhBarAnalysis";
|
||||
var send_data = {
|
||||
PowerStationId: stationId,
|
||||
@ -2264,6 +2274,8 @@
|
||||
});
|
||||
//#endregion
|
||||
|
||||
$('#inverter-kWh-convas-div').show();
|
||||
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<button type="button" class="btn btn-success waves-effect waves-themed" onclick="LoadInvertAnalysisHeatMap()">查詢</button>
|
||||
</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">
|
||||
<figure class="highcharts-figure">
|
||||
<div id="container"></div>
|
||||
|
||||
@ -1456,22 +1456,6 @@
|
||||
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>
|
||||
}
|
||||
@ -153,3 +153,24 @@ function ChangePassword() {
|
||||
}
|
||||
}
|
||||
//#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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user