From 784f09b46a33b8dc49be3fdcc7e8b22f76517ba4 Mon Sep 17 00:00:00 2001 From: Kai Date: Sat, 11 Sep 2021 17:15:58 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E9=A1=AF=E7=A4=BA=202.=20=E9=9B=BB=E7=AB=99=E5=A0=B1=E8=A1=A8?= =?UTF-8?q?=20=E5=8A=A0=E5=85=A5Loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Views/StationReport/Index.cshtml | 118 ++++++++++++++++++-- SolarPower/wwwroot/js/app.bundle.js | 23 ++-- 2 files changed, 125 insertions(+), 16 deletions(-) diff --git a/SolarPower/Views/StationReport/Index.cshtml b/SolarPower/Views/StationReport/Index.cshtml index f58d198..2e6d489 100644 --- a/SolarPower/Views/StationReport/Index.cshtml +++ b/SolarPower/Views/StationReport/Index.cshtml @@ -346,9 +346,9 @@ $('#monthbtn').hide(); $('#yearbtn').show(); $('#daybtn').show(); - document.getElementById("monthbtn").disabled = true;//月報表鎖定 + @*document.getElementById("monthbtn").disabled = true;//月報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 - document.getElementById("daybtn").disabled = false;//日報表鎖定 + document.getElementById("daybtn").disabled = false;//日報表鎖定*@ break; case 1: @@ -386,9 +386,9 @@ $('#daybtn').hide(); $('#monthbtn').show(); $('#yearbtn').show(); - document.getElementById("daybtn").disabled = true;//日報表鎖定 + @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定 - document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 + document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ break; case 2: $('#DateGet').prop({ 'type': 'month' }); $(".btn-change-quickSearch1").html("本月"); @@ -398,9 +398,9 @@ $('#daybtn').hide(); $('#monthbtn').show(); $('#yearbtn').show(); - document.getElementById("daybtn").disabled = true;//日報表鎖定 + @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定 - document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 + document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ break; case 3: $(".btn-change-quickSearch1").html("今年"); @@ -411,9 +411,9 @@ $('#daybtn').hide(); $('#monthbtn').hide(); $('#yearbtn').show(); - document.getElementById("daybtn").disabled = true;//日報表鎖定 + @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = true;//月報表鎖定 - document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 + document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ break; } if (type == 1) { @@ -674,12 +674,81 @@ FormType: form, PowerStation: nowpowerstation } + + switch (form) { + case 0: + $("#daybtn").html('').attr("disabled", true); + $("#monthbtn").attr("disabled", true); + $("#yearbtn").attr("disabled", true); + $("#year2btn").attr("disabled", true); + $(".btn-station").attr("disabled", true); + break; + case 1: + $("#daybtn").attr("disabled", true); + $("#monthbtn").html('').attr("disabled", true); + $("#yearbtn").attr("disabled", true); + $("#year2btn").attr("disabled", true); + $(".btn-station").attr("disabled", true); + break; + case 2: + $("#daybtn").attr("disabled", true); + $("#monthbtn").attr("disabled", true); + $("#yearbtn").html('').attr("disabled", true); + $("#year2btn").attr("disabled", true); + $(".btn-station").attr("disabled", true); + break; + case 3: + $("#daybtn").attr("disabled", true); + $("#monthbtn").attr("disabled", true); + $("#yearbtn").attr("disabled", true); + $("#year2btn").attr('', true); + $(".btn-station").attr("disabled", true); + break; + } + var url = "/StationReport/GetTableHead"; $.post(url, send_data, function (rel) { if (rel.code != "0000") { toast_warning(rel.msg); + + switch (form) { + case 0: + $("#daybtn").html('日報表').attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 1: + $("#daybtn").attr("disabled", false); + $("#monthbtn").html('月報表').attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 2: + $("#daybtn").attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").html('綜合報表').attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 3: + $("#daybtn").attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").html('年報表').attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + } + + return; } + + + + $('#TableHead').empty(); var str = ""; switch (form) @@ -756,6 +825,38 @@ } var url = "/StationReport/GetForm"; $.post(url, send_data, function (rel) { + + switch (form) { + case 0: + $("#daybtn").html('日報表').attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 1: + $("#daybtn").attr("disabled", false); + $("#monthbtn").html('月報表').attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 2: + $("#daybtn").attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").html('綜合報表').attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 3: + $("#daybtn").attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").html('年報表').attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + } + if (rel.code != "0000") { if (rel.code == "9985") { toast_warning(rel.msg); @@ -766,6 +867,7 @@ $('#totbody').empty(); return; } + var sta = ""; $('#TableBody').empty(); $('#totbody').empty(); diff --git a/SolarPower/wwwroot/js/app.bundle.js b/SolarPower/wwwroot/js/app.bundle.js index a2e17eb..4401082 100644 --- a/SolarPower/wwwroot/js/app.bundle.js +++ b/SolarPower/wwwroot/js/app.bundle.js @@ -1223,15 +1223,22 @@ var initApp = (function(app) { }); /* Add app date to js-get-date */ - if ( myapp_config.appDateHook.length ) { - var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - day = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + if (myapp_config.appDateHook.length) { + var months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], + day = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], now = new Date(), - formatted = day[now.getDay()] + ', ' + - months[now.getMonth()] + ' ' + - now.getDate() + ', ' + - now.getFullYear(); - myapp_config.appDateHook.text(formatted); + formatted = now.getFullYear() + '-' + months[now.getMonth()] + '-' + now.getDate(); + + myapp_config.appDateHook.text(formatted); + + //var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + // day = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + // now = new Date(), + // formatted = day[now.getDay()] + ', ' + + // months[now.getMonth()] + ' ' + + // now.getDate() + ', ' + + // now.getFullYear(); + //myapp_config.appDateHook.text(formatted); } /* Check conflicting classes to build/destroy slimscroll */