赣州市洪水风险预警系统三维版本
guoshilong
2023-02-27 4d8c6dd77427e8e581fda17b6b65ba86bfb7a815
themes/FoldableTheme/widgets/HeaderController/Widget.js
@@ -47,7 +47,6 @@
         flag: false,
         flags: false,
         megflag: false,
         floodAnalysisFlag:false,
         postCreate: function () {
            this.inherited(arguments);
@@ -98,7 +97,12 @@
            this.resize();
            setTimeout(lang.hitch(this, this.resize), 100);
            //根据部件名称启动部件
            topic.subscribe('runWidgetByName', lang.hitch(this, this._runWidgetByName));
            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(unescape(r[2]))));
            else
               topic.subscribe('runWidgetByName', lang.hitch(this, this._runWidgetByName('FloodAnalysis')));
         },
         _runWidgetByName: function (name) {
            for (i = 0; i < this.appConfig.widgetPool.widgets.length; i++) {
@@ -737,7 +741,7 @@
            } else {
               iconUrl = iconConfig.icon;
            }
            if (iconConfig.name == "AnalysisOfBarrierLake" || iconConfig.name == 'ThematicDynamicRiver' || iconConfig.name == "MapSection" || iconConfig.name == "FloodAnalysis") {
            if (iconConfig.name == "AnalysisOfBarrierLake" || iconConfig.name == 'ThematicDynamicRiver' || iconConfig.name == "MapSection") {
               node = null;
               return;
            } else {
@@ -760,7 +764,7 @@
                     'position': "absolute",
                     'top': "45px",
                     'left': "0px",
                     'height': '180px',
                     'height': '90px',
                     'width': '126px',
                     'background': 'rgb(0,23,54)',
                     'z-index': '50'
@@ -772,6 +776,7 @@
                  var middleNode = null;
                  var lastNode = null;
                  var finalNode = null;
                  for (var i = 0; i < iconNode.length; i++) {
                     if (iconNode[i].name == 'AnalysisOfBarrierLake') {
                        firstNode = html.create('li', {
@@ -815,7 +820,6 @@
                              }
                              that.flag = true;
                              that.megflag = true;
                              that.floodAnalysisFlag = true;
                           }
                        })
                        firstNode.config = iconNode[i];
@@ -866,7 +870,6 @@
                              }
                              that.flags = true;
                              that.megflag = true;
                              that.floodAnalysisFlag = true
                           }
                        })
                        middleNode.config = iconNode[i];
@@ -917,7 +920,6 @@
                              }
                              that.flag = true;
                              that.flags = true;
                              that.floodAnalysisFlag = true;
                           }
                        })
                        lastNode.config = iconNode[i];
@@ -927,56 +929,6 @@
                        }
                     }
                     if (iconNode[i].name == 'FloodAnalysis'){
                        finalNode = html.create('li', {
                           'class': 'icon-node jimu-float-trailing openli',
                           title: iconNode[i].label,
                           settingId: iconNode[i].id,
                           'data-widget-name': iconNode[i].name,
                           innerHTML: iconNode[i].label
                        }, optionLi[0]);
                        var self = this;
                        $(node).on('click', finalNode, function (event) {
                           if (event.target.innerText == "洪水淹没分析") {
                              $(event.target).parent().parent().stop().hide();
                              if (!finalNode.config.widgets || finalNode.config.widgets.length === 1 ||
                                 finalNode.config.openType === 'openAll') {
                                 //widget or group with 'openAll' open type
                                 if (!that.floodAnalysisFlag) {
                                    $(event.target).parent().parent().siblings().toggleClass('click-icon-node');
                                 }
                                 if (self.openedId && self.openedId === finalNode.config.id) {
                                    self._switchNodeToClose(self.openedId);
                                    return;
                                 } else {
                                    if (self.openedId) {
                                       self._switchNodeToClose(self.openedId).then(lang.hitch(self, function () {
                                          self._closeDropMenu();
                                          self._switchNodeToOpen(finalNode.config.id);
                                       }));
                                    } else {
                                       self._switchNodeToOpen(finalNode.config.id);
                                    }
                                 }
                              } else {
                                 if (self.dropMenuNode) {
                                    self._closeDropMenu();
                                 } else {
                                    self._openDropMenu(finalNode);
                                 }
                              }
                              that.flag = true;
                              that.flags = true;
                              that.megflag = true;
                           }
                        })
                        finalNode.config = iconNode[i];
                        if (finalNode.config.widgets && finalNode.config.widgets.length > 1 &&
                           finalNode.config.openType === 'dropDown') {
                           this._createDropTriangle(finalNode);
                        }
                     }
                  }
                  $(node).mouseover(function () {
@@ -1028,28 +980,7 @@
               }
            }
            // node = html.create('div', {
@@ -1121,6 +1052,11 @@
         },
         _onIconClick: function (node) {
            if (node.innerHTML == '风险预警') {
               window.open('http://192.168.0.207:8080/hsyj/index.html', '_self')
               return
            }
            if (!node.config.widgets || node.config.widgets.length === 1 ||
               node.config.openType === 'openAll') {
               //widget or group with 'openAll' open type