diff --git a/static/modules/utils.js b/static/modules/utils.js index cc6f352..73e055a 100644 --- a/static/modules/utils.js +++ b/static/modules/utils.js @@ -334,8 +334,16 @@ window.setFinView = (view) => { state.finView = view; renderFinance(); }; -window.setFinQuarter = (q) => { state.finQuarter = q; state.finView = 'quarterly'; renderFinance(); }; -window.setFinMonth = (month) => { state.finMonth = month; state.finView = 'monthly'; renderFinance(); }; +window.setFinQuarter = (q) => { + if (state.finView === 'quarterly' && state.finQuarter === q) { state.finView = 'overview'; } + else { state.finQuarter = q; state.finView = 'quarterly'; } + renderFinance(); +}; +window.setFinMonth = (month) => { + if (state.finView === 'monthly' && state.finMonth === month) { state.finView = 'overview'; } + else { state.finMonth = month; state.finView = 'monthly'; } + renderFinance(); +}; window.setFinYear = (year) => { state.finYear = parseInt(year); renderFinance(); }; window.switchFinFilter = (filter) => { state.finFilter = filter; @@ -353,8 +361,16 @@ window.setPlanView = (view) => { state.planView = view; renderPlan(); }; -window.setPlanQuarter = (q) => { state.planQuarter = q; state.planView = 'quarterly'; renderPlan(); }; -window.setPlanMonth = (month) => { state.planMonth = month; state.planView = 'monthly'; renderPlan(); }; +window.setPlanQuarter = (q) => { + if (state.planView === 'quarterly' && state.planQuarter === q) { state.planView = 'overview'; } + else { state.planQuarter = q; state.planView = 'quarterly'; } + renderPlan(); +}; +window.setPlanMonth = (month) => { + if (state.planView === 'monthly' && state.planMonth === month) { state.planView = 'overview'; } + else { state.planMonth = month; state.planView = 'monthly'; } + renderPlan(); +}; window.setPlanYear = (year) => { state.planYear = parseInt(year); renderPlan(); }; window.setPlanStatusFilter = (filter) => { state.planStatusFilter = filter; renderPlan(); }; window.switchPlanFilter = (filter) => { diff --git a/templates/index.html b/templates/index.html index 4ee38e4..df6cf46 100644 --- a/templates/index.html +++ b/templates/index.html @@ -76,7 +76,7 @@
-

OPC Manager v1.2.0.18

+

OPC Manager v1.2.0.19

科普 OPC 工作台