浏览代码

默认的告警转换分类

seimin 1 年之前
父节点
当前提交
4c8467a546

+ 3 - 3
assets/js/config.router.js

@@ -105,7 +105,7 @@ app.config(['$authProvider', '$httpProvider', '$stateProvider', '$urlRouterProvi
105 105
             //         angular.extend(authData,response.data.user);
106 106
             //         return authData;
107 107
             //     // }
108
-            //     // return authData;            
108
+            //     // return authData;
109 109
             // },
110 110
 
111 111
             parseExpiry: function (headers) {
@@ -1406,7 +1406,7 @@ app.config(['$authProvider', '$httpProvider', '$stateProvider', '$urlRouterProvi
1406 1406
                 }
1407 1407
             })
1408 1408
 
1409
-            
1409
+
1410 1410
 
1411 1411
             //巡检管理>巡检报告
1412 1412
             .state('app.inspection.inspectReport', {
@@ -1831,7 +1831,7 @@ app.config(['$authProvider', '$httpProvider', '$stateProvider', '$urlRouterProvi
1831 1831
             .state('app.system.sysconfig', {
1832 1832
                 url: '/sysconfig',
1833 1833
                 templateUrl: "assets/views/system/sysconfig.html",
1834
-                resolve: loadSequence('jquery-sparkline', 'spin', 'ladda', 'angular-ladda', 'ui.grid', 'sysconfigCtrl'),
1834
+                resolve: loadSequence('jquery-sparkline', 'spin', 'ladda', 'angular-ladda', 'ui.grid', 'multi.select.tree', 'sysconfigCtrl'),
1835 1835
                 title: 'Nav Manager',
1836 1836
                 ncyBreadcrumb: {
1837 1837
                     label: 'User Manager'

+ 23 - 15
assets/js/controllers/desk/jry_emergencyCtrl.js

@@ -1,8 +1,8 @@
1 1
 'use strict';
2 2
 
3
-app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$timeout", "$interval", "$modal", "SweetAlert", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_bpm_data", "api_text", 'moment','api_wechatfile',
3
+app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$timeout", "$interval", "$modal", "SweetAlert", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_bpm_data", "api_text", 'moment','api_wechatfile','api_sysinfo',
4 4
 
5
-    function($scope, i18nService, $rootScope, $state, $timeout, $interval, $modal, SweetAlert, uiGridConstants, uiGridGroupingConstants, Restangular, api_bpm_data, api_text, moment,api_wechatfile) {
5
+    function($scope, i18nService, $rootScope, $state, $timeout, $interval, $modal, SweetAlert, uiGridConstants, uiGridGroupingConstants, Restangular, api_bpm_data, api_text, moment,api_wechatfile,api_sysinfo) {
6 6
 
7 7
         console.log($scope);
8 8
 
@@ -143,7 +143,7 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
143 143
 
144 144
                     '</div>'
145 145
 
146
-            }, 
146
+            },
147 147
             // {
148 148
 
149 149
             //     name: 'requester.name',
@@ -158,7 +158,7 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
158 158
 
159 159
             //         '</div>'
160 160
 
161
-            // }, 
161
+            // },
162 162
             {
163 163
 
164 164
                 name: 'alarmStatus',
@@ -215,7 +215,7 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
215 215
 
216 216
                     '</div>'
217 217
 
218
-            }, 
218
+            },
219 219
             {
220 220
 
221 221
                 name: 'createTime',
@@ -438,7 +438,7 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
438 438
 
439 439
                 $scope.refreshData('expand-right', $scope.fileData);
440 440
 
441
-                // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});                                            
441
+                // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});
442 442
 
443 443
             });
444 444
 
@@ -447,7 +447,7 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
447 447
                 if (data.isSelected) {
448 448
                     $scope.selected.items.push(data.entity);
449 449
                 } else {
450
-                    //objs:需要遍历的集合 data:遍历时当前的数据 index:遍历时当前索引 
450
+                    //objs:需要遍历的集合 data:遍历时当前的数据 index:遍历时当前索引
451 451
                     //array:需要遍历的集合,每次遍历时都会把objs原样的传一次。
452 452
                     //angular.forEach(objs, function(data,index,array)
453 453
                     angular.forEach($scope.selected.items, function (ObjIndex, index, destObj) {
@@ -589,12 +589,20 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
589 589
 
590 590
             }
591 591
 
592
-
593
-
594
-            console.log(formdata);
595
-
596
-            $state.go('app.incident.chart', { 'model': JSON.stringify(formdata) });
597
-
592
+            api_sysinfo.fetchDataList("systemConfiguration", {
593
+                "idx": 0,
594
+                "sum": 999
595
+            }).then(function (data) {
596
+                if (data.status == 200) {
597
+                    data.list = data.list || [];
598
+                    var alarmCategory = data.list.find(v => v.keyconfig == 'alarmCategory');
599
+                    if(alarmCategory && alarmCategory.valueconfig){
600
+                        formdata.model.incident.category = {id: alarmCategory.valueconfig}
601
+                    }
602
+                    console.log(formdata)
603
+                    $state.go('app.incident.chart', { 'model': JSON.stringify(formdata) });
604
+                }
605
+            });
598 606
         };
599 607
 
600 608
         $scope.lookFunction = function(data) {
@@ -834,7 +842,7 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
834 842
 
835 843
                 //         $scope.notBeing = true;
836 844
 
837
-                //     } 
845
+                //     }
838 846
 
839 847
 
840 848
 
@@ -1002,7 +1010,7 @@ app.controller('WechatOperCtrl2', ['$rootScope', '$http', '$scope', '$modal', 'S
1002 1010
 
1003 1011
                         })
1004 1012
 
1005
-                        
1013
+
1006 1014
 
1007 1015
                     } else {
1008 1016
 

+ 18 - 18
assets/js/controllers/incident/incidentCtrl.js

@@ -845,7 +845,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
845 845
         //             api_bpm_data.fetchDataList('incidentcategory',postData).then(function(data){
846 846
         //                 console.log(data)
847 847
         //                     var myData = Restangular.stripRestangular(data);
848
-        //                     $scope.propTypeOptions = myData[2].form.fields;   
848
+        //                     $scope.propTypeOptions = myData[2].form.fields;
849 849
         //                     // console.log($scope.propTypeOptions)
850 850
         //             });
851 851
         //         }
@@ -965,7 +965,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
965 965
             item.source = undefined;
966 966
         }
967 967
         console.log(item)
968
-        
968
+
969 969
         var fildata = {};
970 970
         if (sessionStorage.searchincident) {
971 971
             fildata = JSON.parse(sessionStorage.getItem("searchincident"));
@@ -990,7 +990,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
990 990
         //     angular.extend(fildata, { 'idx': 0, 'sum': $scope.gridOptions.paginationPageSize })
991 991
         //     angular.extend(fildata.incident, { 'acceptDate': moment(parameters.paramDateFrom).format('YYYY-MM-DD 00:00:00'), 'acceptDateEnd': moment(parameters.paramDateTo).format('YYYY-MM-DD 23:59:59') })
992 992
         // }
993
-        
993
+
994 994
         var transitiondata = angular.copy(item);
995 995
         angular.extend(fildata.incident, transitiondata)
996 996
         sessionStorage['searchincident'] = JSON.stringify(fildata);
@@ -998,7 +998,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
998 998
         fildata.assignee = loginUser.id;
999 999
         // seimin
1000 1000
         if($scope.searchstate === 'all_del'){
1001
-            fildata.searchType = 'all'; 
1001
+            fildata.searchType = 'all';
1002 1002
         }else{
1003 1003
             fildata.searchType = $scope.searchstate;
1004 1004
         }
@@ -1309,7 +1309,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1309 1309
                 filtersData.assignee = loginUser.id;
1310 1310
                 $scope.refreshData('expand-right', filtersData);
1311 1311
             }
1312
-            // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});                                            
1312
+            // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});
1313 1313
         });
1314 1314
 
1315 1315
         // gridApi.selection.on.rowSelectionChanged($scope, function(data) {
@@ -1525,7 +1525,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1525 1525
                 // {name:"处理结果",value:data.handleResult}];
1526 1526
                 // {name:"用户评价",value:''},
1527 1527
                 // {name:"满意度",value:''},
1528
-                // {name:"用户签字",value:''}];                                                                         
1528
+                // {name:"用户签字",value:''}];
1529 1529
                 $scope.cancel = function () {
1530 1530
                     $modalInstance.dismiss('cancel');
1531 1531
                 };
@@ -1709,7 +1709,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1709 1709
                         filtersData.idx = newPage - 1;
1710 1710
                         filtersData.sum = pageSize;
1711 1711
                         $scope.loadData(filtersData);
1712
-                        // $scope.loadData({"idx":newPage-1,"sum":pageSize});                                            
1712
+                        // $scope.loadData({"idx":newPage-1,"sum":pageSize});
1713 1713
                     });
1714 1714
                     gridApi.selection.on.rowSelectionChanged($scope, function (scope) {
1715 1715
                         scope.grid.appScope.selected.items[0] = scope.entity;
@@ -1812,7 +1812,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1812 1812
     // };
1813 1813
 
1814 1814
     /*
1815
-      appScopeProvider: { 
1815
+      appScopeProvider: {
1816 1816
           onDblClick : function(row) {
1817 1817
              var url = '//google.com';
1818 1818
              $window.open(url, "_blank", "height=600,width=800,toolbar=no,location=no,menubar=no,titlebar=no");
@@ -2321,7 +2321,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2321 2321
                     $scope.assignGroup = item.id;
2322 2322
                     $scope.getUsers(item.id)
2323 2323
                 }
2324
-                
2324
+
2325 2325
                 $scope.ok = function () {
2326 2326
                     if (!$scope.assignUser){
2327 2327
                         Alert.swal({
@@ -2674,7 +2674,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2674 2674
         //     }
2675 2675
         // }
2676 2676
         // // -----------seimin-------------
2677
-        
2677
+
2678 2678
         // $scope.refreshData('expand-right', defaultFilterData);
2679 2679
         // $interval.cancel($scope.timer);
2680 2680
         // $scope.timer = $interval(function () {
@@ -2941,7 +2941,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2941 2941
         //$scope.callsPending++;
2942 2942
         $scope.memoryfilterData = filterData;
2943 2943
         $scope.gridOptions['sum'] = filterData.sum;
2944
-        
2944
+
2945 2945
         api_bpm_domain.fetchtask(pdKey, filterData).then(function (data) {
2946 2946
             if (data.data) {
2947 2947
                 // if(filterData.searchType == 'all'){
@@ -2963,7 +2963,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2963 2963
                 });
2964 2964
             }
2965 2965
             $scope.ldloading[style.replace('-', '_')] = false;
2966
-            
2966
+
2967 2967
         }, function () {
2968 2968
             $scope.ldloading[style.replace('-', '_')] = false;
2969 2969
         });
@@ -3139,7 +3139,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
3139 3139
         }
3140 3140
         $scope.refreshData('expand-right');
3141 3141
     }
3142
-    
3142
+
3143 3143
     $scope.timer = $interval(function () {
3144 3144
         $scope.jry_refresh()
3145 3145
     }, $rootScope.refreshTime);
@@ -3269,7 +3269,7 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
3269 3269
         } else {
3270 3270
             return false
3271 3271
         }
3272
-        // }   
3272
+        // }
3273 3273
     }
3274 3274
     $scope.coordination = function () {
3275 3275
         $scope.colobject.grid.appScope.coordination($scope.item);
@@ -3373,16 +3373,16 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
3373 3373
     //       $scope.data={
3374 3374
     //           "name":"视频",
3375 3375
     //           "url":"http://192.168.3.69:8088/recording/recording?callID="+$rootScope.callid
3376
-    //       };  
3376
+    //       };
3377 3377
     //       $scope.data.url = $sce.trustAsResourceUrl($scope.data.url);
3378 3378
 
3379 3379
     //         // $scope.audiourl={url:$sce.trustAsResourceUrl("http://192.168.3.69:8088/recording/recording?callID=218147232")};
3380 3380
 
3381 3381
     //         $scope.cancel = function() {
3382 3382
     //                 $modalInstance.dismiss('cancel');
3383
-    //             };       
3384
-    //             $modalInstance.close();  
3385
-    //       } 
3383
+    //             };
3384
+    //             $modalInstance.close();
3385
+    //       }
3386 3386
     //     });
3387 3387
     // };
3388 3388
 

+ 185 - 1
assets/js/controllers/system/sysconfigCtrl.js

@@ -1,5 +1,5 @@
1 1
 "use strict";
2
-app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "$interval", "$modal", "$window", "SweetAlert", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_sysinfo", "api_is_category", function (t, a, n, e, i, s, r, o, l, u, d, c, g, api_is_category) {
2
+app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "$interval", "$modal", "$window", "SweetAlert", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_sysinfo", "api_is_category", "api_bpm_data", function (t, a, n, e, i, s, r, o, l, u, d, c, g, api_is_category, api_bpm_data) {
3 3
     a.langs = l.getAllLangs(), a.lang = "zh-cn", l.setCurrentLang(a.lang);
4 4
     var f = (t.user, r._, {
5 5
         idx: 0,
@@ -10,6 +10,179 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
10 10
         var v = parseFloat(e.target.value)?parseFloat(e.target.value):0;
11 11
         a.autoCloseIncidentHour.valueconfig  = v > 0 ? v : 0;
12 12
     }
13
+
14
+    function convertListToTree(data, treeMap) {
15
+        var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
16
+        var root = null; //Initially set our loop to null
17
+        var parentNode = null;
18
+        //loop over data
19
+        for (var i = 0; i < data.length; i++) {
20
+            var datum = data[i];
21
+            //each node will have children, so let's give it a "children" poperty
22
+            datum.children = [];
23
+
24
+            //add an entry for this node to the map so that any future children can
25
+            //lookup the parent
26
+            idToNodeMap[datum.id] = datum;
27
+
28
+            //Does this node have a parent?
29
+            if (typeof datum.parent === "undefined" || datum.parent == null) {
30
+                //Doesn't look like it, so this node is the root of the tree
31
+                root = datum;
32
+                treeMap[datum.id] = root;
33
+            } else {
34
+                //This node has a parent, so let's look it up using the id
35
+                parentNode = idToNodeMap[datum.parent.id];
36
+
37
+                //We don't need this property, so let's delete it.
38
+                delete datum.parent;
39
+
40
+                //Let's add the current node as a child of the parent node.
41
+                parentNode.children.push(datum);
42
+            }
43
+        }
44
+        return root;
45
+    }
46
+
47
+    function convertParentToChildList(data) {
48
+        var treeMap = {};
49
+        var list = [];
50
+        convertListToTree(data, treeMap);
51
+        angular.forEach(treeMap, function (item) {
52
+            list.push(item);
53
+        });
54
+        return list;
55
+    }
56
+    // 将事件分类搜索结果返回的数据整理成children模式
57
+    function transform(nodes) {
58
+        var treeConverter = {
59
+            result: null, //转化后的结果,是根节点,所有节点都是从根节点长出来的
60
+            attributeName: 'id', //节点唯一标识符
61
+            needFind: true, //是否查询节点在result中已经存在,为了优化效率
62
+            transform: function (node) { //转化递归函数,参数:一个待插入节点
63
+
64
+                if (node.parent != null) { //该节点有父节点
65
+                    var newNode = this.transform(node.parent); //递归进入,返回值为一个节点,用作父节点,该父节点必然存在于result中,这点由下面的算法可以控制
66
+                    if (this.needFind) {
67
+                        for (var i = 0; i < newNode.children.length; i++) { //查找要插入的node子节点是否在newNode这个父节点中存在
68
+                            if (newNode.children[i][this.attributeName] === node[this.attributeName]) {
69
+                                return newNode.children[i]; //存在的话直接返回newNode父节点内的该子节点,该子节点必然存在于result中,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
70
+                            }
71
+                        }
72
+                    }
73
+                    this.needFind = false; //不存在的话,关闭之后递归的循环判断,因为待插入node节点不存在于result中,故而它的子节点一定不存在于result中,不用再循环判断
74
+                    //   delete node.parent; //删除该节点的parent属性,如果有的话
75
+                    node.children = []; //因为确定是要新插入的节点,没有children:[]属性,故给该节点增加children:[]属性
76
+
77
+                    newNode.children.push(node); //将该node节点push进newNode的子节点数组中
78
+                    return node; //return该新插入节点,作为递归返回值给上层,用作newNode父节点,node存在于result中故newNode存在于result中
79
+                } else if (node.parent == null) { //该叶节点没有父节点,即为根节点
80
+                    //   delete node.parent; //删除该节点的parent属性,如果有的话
81
+                    if (this.result == null) { //根节点不存在
82
+                        node.children = []; //给该节点增加children:[]属性
83
+                        return this.result = node; //该节点赋给result,并return根节点,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
84
+                    } else {
85
+                        node.children = [];
86
+                        // 顶级去重
87
+                        for (var i = 0; i < this.result.children.length; i++) {
88
+                            if (this.result.children[i][this.attributeName] === node[this.attributeName]) {
89
+                                return this.result.children[i];
90
+                            }
91
+                        }
92
+                        this.result.children.push(node)
93
+                        return node // 直接return根节点,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
94
+                    }
95
+                }
96
+            },
97
+            getWhole: function (nodes, attributeName) { //传入整个叶子节点数组,attributeName作为节点唯一标识符属性,返回整个转化结果
98
+                var _node = {};
99
+                _node.children = [];
100
+                this.result = _node; //重置根节点
101
+                this.attributeName = attributeName == null ? 'id' : attributeName; //唯一标识符默认为“id”
102
+                nodes = JSON.parse(JSON.stringify(nodes)); //复制出一个新的节点对象作为参数,保证不改变原有数据
103
+                nodes.forEach(item => { //循环调用转化方法
104
+                    this.needFind = true; //重置开启节点是否已存在判断,保证不插入重复节点
105
+                    this.transform(item);
106
+                })
107
+                return this.result; //返回根节点
108
+            }
109
+        }
110
+        var result = treeConverter.getWhole(nodes); //调用
111
+        return result;
112
+    }
113
+    a.select_treedata = [];
114
+    t.bala1 = a.try_async_load = function (s, fn, showValue) {
115
+        if (s) {
116
+            var filterKeyword = s.filterKeyword;
117
+        }
118
+        var postData = {
119
+            "idx": 0,
120
+            "sum": 1000
121
+        }
122
+        if (filterKeyword) {
123
+            postData.incidentcategory = { selectType: "pinyin_qs", category: filterKeyword }
124
+        }
125
+        a.my_data = [];
126
+        a.doing_async = true;
127
+        api_bpm_data.fetchDataList('incidentcategory', postData).then(function (response) {
128
+            if (response.status == 200) {
129
+                var data = response.list;
130
+                if (filterKeyword) {
131
+                    data.forEach(e => {
132
+                        e.isExpanded = true;
133
+                    })
134
+                    var li = transform(data).children;
135
+                    console.log(li)
136
+                    fn(li)
137
+                    return;
138
+                } else {
139
+                    var objects = [];
140
+                    for (var i = 0; i < data.length; i++) {
141
+                        var object = {};
142
+                        object.id = data[i].id;
143
+                        object.parent = data[i].parent;
144
+                        object.category = data[i].category;
145
+                        object.isExpanded = true;
146
+                        objects.push(object);
147
+                    }
148
+                    a.my_data = convertParentToChildList(objects);
149
+                    a.select_treedata = angular.copy(a.my_data);
150
+                    if(showValue){
151
+                        console.log(a.select_treedata);
152
+                        var itemValue = a.select_treedata.find(v => v.id == showValue.valueconfig);
153
+                        if(itemValue){
154
+                            itemValue.selected = true;
155
+                        }else{
156
+                            selectChildrenItem(a.select_treedata, showValue);
157
+                        }
158
+                    }
159
+                }
160
+                if (a.my_data.length > 0) {
161
+                    a.doing_async = false;
162
+                }
163
+            } else {
164
+                SweetAlert.swal({
165
+                    title: "系统错误!",
166
+                    text: "请刷新重试!",
167
+                    type: "error"
168
+                });
169
+            }
170
+        });
171
+    };
172
+    function selectChildrenItem(arr, showValue){
173
+        var arrs = [];
174
+        arr.forEach(v => {
175
+            if(Array.isArray(v.children) && v.children.length){
176
+                arrs = arrs.concat(v.children);
177
+            }
178
+        })
179
+        var itemValue = arrs.find(v => v.id == showValue.valueconfig);
180
+        if(itemValue){
181
+            itemValue.selected = true;
182
+        }else{
183
+            selectChildrenItem(arrs, showValue);
184
+        }
185
+    }
13 186
     //保存
14 187
     a.savesystem = function () {
15 188
         var arr = {};
@@ -26,6 +199,13 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
26 199
         arr.systemConfiguration.push(a.wxIncidentWithCmdb);//是否需要绑定资产
27 200
         arr.systemConfiguration.push(a.requesterLgoinType);//保修人登录方式
28 201
         arr.systemConfiguration.push(a.autoCloseIncidentHour);//自动关单小时
202
+        if(a.cifilter_classic){
203
+            a.alarmCategory.valueconfig = a.cifilter_classic.id + '';
204
+            arr.systemConfiguration.push(a.alarmCategory);//默认的告警转换分类
205
+        }else{
206
+            a.alarmCategory.valueconfig = '';
207
+            arr.systemConfiguration.push(a.alarmCategory);//默认的告警转换分类
208
+        }
29 209
         console.log(arr,99999);
30 210
         g.addData("systemConfiguration", arr).then(function (t) {
31 211
             if (t.status == 200) {
@@ -111,6 +291,10 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
111 291
                         v.valueconfig = parseFloat(v.valueconfig)
112 292
                         a.autoCloseIncidentHour = v;//自动关单小时
113 293
                     }
294
+                    if (v.keyconfig == 'alarmCategory') {
295
+                        a.alarmCategory = v;
296
+                        a.try_async_load(null, null, v);
297
+                    }
114 298
                 })
115 299
             }else{
116 300
                 console.log(n.status);

+ 18 - 1
assets/views/system/sysconfig.html

@@ -185,6 +185,18 @@
185 185
                         </ul>
186 186
                     </div>
187 187
                 </div>
188
+                <div class="form-group col-sm-6">
189
+                    <label class="col-sm-4 control-label">
190
+                        默认的告警转换分类:
191
+                    </label>
192
+                    <div class="col-sm-8">
193
+                        <multi-select-tree data-default-label="请选择事件分类" class="selectzise wt_width1 wt_width3"
194
+                            ng-model="cifilter_classic" data-input-model="select_treedata"
195
+                            data-output-model="cifilter_classic" theme="bootstrap" multi-select="false"  data-select-only-leafs="true"
196
+                            reset-search-input="false" data-trans-label="category" data-switch-view="false">
197
+                        </multi-select-tree>
198
+                    </div>
199
+                </div>
188 200
             </div>
189 201
             <!-- 保存 -->
190 202
             <div class="form-group margin-bottom-0">
@@ -229,13 +241,18 @@
229 241
         border-top: none;
230 242
         color: #333;
231 243
         font-size: 14px;
232
-        overflow: hidden;
233 244
         padding-top: 16px;
234 245
         padding-bottom: 16px;
235 246
         background-color: #f9f9f9;
236 247
         margin-bottom: 16px;
237 248
     }
238 249
 
250
+    .panel-bd::after{
251
+        content: '';
252
+        display: block;
253
+        clear: both;
254
+    }
255
+
239 256
     .control-label {
240 257
         height: 34px;
241 258
         line-height: 34px;