Browse Source

所有指标接口修改

wangrulan 2 years ago
parent
commit
6f8e72a92f
1 changed files with 23 additions and 10 deletions
  1. 23 10
      src/main/resources/templates/template.html

+ 23 - 10
src/main/resources/templates/template.html

@@ -211,6 +211,7 @@
             });
             initTreeCity(tree)
             initTreeIndicator(tree)
+            initAllIndicator(tree)
             initTreeIndicatorTemplate(tree)
             // console.log(window.sessionStorage.getItem('userName'))
             $("#userName").text(window.sessionStorage.getItem('userName'))
@@ -275,19 +276,12 @@
             });
         }
 
-        function initTreeIndicator(tree) {
+        function initAllIndicator(tree) {
             $.ajax({
                 type: "POST",
-                url: '/api/initTreeIndicator',
+                url: '/api/allIndicator',
                 success: function (r) {
                     if (r?.success) {
-                        treeIn = tree.render({
-                            elem: '#allIndicator',
-                            showCheckbox: true,
-                            accordion: true,
-                            id: 'Id2',
-                            data: r?.data,
-                        });
                         treeIn = tree.render({
                             elem: '#allMetrics',
                             showCheckbox: true,
@@ -313,7 +307,26 @@
                 }
             });
         }
-
+        
+        function initTreeIndicator(tree) {
+            $.ajax({
+                type: "POST",
+                url: '/api/initTreeIndicator',
+                success: function (r) {
+                    if (r?.success) {
+                        treeIn = tree.render({
+                            elem: '#allIndicator',
+                            showCheckbox: true,
+                            accordion: true,
+                            id: 'Id2',
+                            data: r?.data,
+                        });
+                        return
+                    }
+                    alert(r?.message ?? '发生错误了');
+                }
+            });
+        }
         function renderTable(condition, searchType, table, citys, quxians, indicators, timeType, startTime, endTime) {
             var tishi = layer.load(1, {
                 shadeClose: false,