From 19fa00e220e8c75174be9b02c3786b0ec11a7bda Mon Sep 17 00:00:00 2001 From: mac Date: Fri, 10 Jul 2026 23:22:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AD=A3=E5=BA=A6/=E6=9C=88=E5=BA=A6?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=86=8D=E6=AC=A1=E7=82=B9=E5=87=BB=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - setPlanQuarter/setPlanMonth增加toggle逻辑 - setFinQuarter/setFinMonth增加toggle逻辑 - 再次点击已选中的季度/月份回到overview总视图 - 版本号 v1.2.0.19 --- static/modules/utils.js | 24 ++++++++++++++++++++---- templates/index.html | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) 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 工作台