From 7677e73e105574a09b2c6253398c69336d9f3e22 Mon Sep 17 00:00:00 2001
From: xiebin <123456>
Date: Mon, 20 Feb 2023 10:01:26 +0800
Subject: [PATCH] 增加浏览器地址根据参数跳转指定菜单

---
 themes/FoldableTheme/widgets/HeaderController/Widget.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/themes/FoldableTheme/widgets/HeaderController/Widget.js b/themes/FoldableTheme/widgets/HeaderController/Widget.js
index 68840a8..23b8cf3 100644
--- a/themes/FoldableTheme/widgets/HeaderController/Widget.js
+++ b/themes/FoldableTheme/widgets/HeaderController/Widget.js
@@ -97,7 +97,12 @@
 				this.resize();
 				setTimeout(lang.hitch(this, this.resize), 100);
 				//根据部件名称启动部件
-				topic.subscribe('runWidgetByName', lang.hitch(this, this._runWidgetByName('ComprehensiveSupervise')));
+				var reg = new RegExp("(^|&)"+ 'path' +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
+				var r = window.location.search.substr(1).match(reg);  //匹配目标参数
+				if (r!=null) //如果有参数跳转洪水淹没分析部件
+					topic.subscribe('runWidgetByName', lang.hitch(this, this._runWidgetByName('FloodAnalysis')));
+				else
+					topic.subscribe('runWidgetByName', lang.hitch(this, this._runWidgetByName('ComprehensiveSupervise')));
 			},
 			_runWidgetByName: function (name) {
 				for (i = 0; i < this.appConfig.widgetPool.widgets.length; i++) {

--
Gitblit v1.9.3