瀏覽代碼

溫度報警

gaodd 2 年之前
父節點
當前提交
57d16b62a2

+ 3 - 6
src/main/resources/static/app/business/module.js

@@ -197,17 +197,14 @@ angular.module('app.business')
197 197
         })
198 198
         // 温度报警
199 199
         .state('app.business.warning.temperature', {
200
-                url: '/business/warning/temperature/:isShow/:houseId',
200
+                url: '/business/warning/temperature',
201 201
                 data: {
202 202
                     title: '温度报警列表'
203 203
                 },
204
-                params:{
205
-                    showType : "WD"
206
-                },
207 204
                 views: {
208 205
                     "content@app": {
209
-                        controller: 'warningThresholdCtrl',
210
-                        templateUrl: 'app/intelligent/grainDetection/views/warningThreshold-list.html'
206
+                        controller: 'sptWdbjCtrl',
207
+                        templateUrl: 'app/supervise/views/tempAlarm-list.html'
211 208
                     }
212 209
                 }
213 210
             }

+ 34 - 0
src/main/resources/static/app/supervise/controller/sptCtrl.js

@@ -49,4 +49,38 @@ angular.module('app.supervise').controller("sptSxtgzsCtrl", function($scope, $ro
49 49
         $scope.loadData();
50 50
     };
51 51
 
52
+})
53
+
54
+.controller("sptWdbjCtrl", function($scope, $rootScope, $state, $stateParams, APP_CONFIG, sptService) {
55
+
56
+    // 获取列表数据
57
+    $scope.pageInfo = {pageNum : 1, pageSize : 10};
58
+
59
+    $scope.search = {kqbm:$rootScope.orgInfo.kqbm,cfbm:""};
60
+    $scope.loadData = function() {
61
+    	$scope.search.searchStartDate = $("#startDate").val();
62
+    	$scope.search.searchEndDate = $("#endDate").val();
63
+    	
64
+		sptService.getTempAlarmPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $scope.search).then(function (data) {
65
+			$scope.pageInfo = data;
66
+		}, function (data) {
67
+			console.log(data);
68
+		});
69
+    };
70
+    
71
+    $scope.loadData();
72
+
73
+    // 翻页
74
+    $scope.goPage = function(pageNum) {
75
+        $scope.pageInfo.pageNum = pageNum;
76
+        $scope.loadData();
77
+    };
78
+
79
+    $scope.emptyTime = function() {
80
+    	$("#startDate").val("");
81
+    	$("#endDate").val("");
82
+    	$scope.search.cfbm = "";
83
+        $scope.loadData();
84
+    };
85
+    
52 86
 });

+ 26 - 0
src/main/resources/static/app/supervise/service/sptService.js

@@ -49,5 +49,31 @@ angular.module('app.supervise').service("sptService", function($http, $q, APP_CO
49 49
         });
50 50
         return d.promise;
51 51
     };
52
+    
53
+    /**
54
+     * 溫度報警
55
+     */
56
+    this.getTempAlarmPageInfo = function(pageNum, pageSize,search) {
57
+        var d = $q.defer();
58
+        $http({
59
+            method : 'GET',
60
+            url : APP_CONFIG.depotStorageUrl + '/spt/getTempAlarmList',
61
+            params : {
62
+                pageNum : pageNum,
63
+                pageSize : pageSize,
64
+                kqbm : search.kqbm, 
65
+                cfbm : search.cfbm,
66
+                searchStartDate : search.searchStartDate,
67
+                searchEndDate : search.searchEndDate
68
+            }
69
+        }).then(function successCallback(response) {
70
+            // 请求成功执行代码
71
+            d.resolve(response.data);
72
+        }, function errorCallback(response) {
73
+            // 请求失败执行代码
74
+            d.reject("error");
75
+        });
76
+        return d.promise;
77
+    };
52 78
 
53 79
 });

+ 94 - 0
src/main/resources/static/app/supervise/views/tempAlarm-list.html

@@ -0,0 +1,94 @@
1
+<!-- MAIN CONTENT -->
2
+<div id="content">
3
+    <!-- widget grid -->
4
+    <section widget-grid id="widget-grid">
5
+        <div class="row">
6
+            <article class="col-sm-12">
7
+
8
+                <div jarvis-widget id="standard-datatable-widget" data-widget-color="darken"
9
+                     data-widget-editbutton="true">
10
+                    <header>
11
+                        <span class="widget-icon"> <i class="fa fa-table"></i> </span>
12
+                        <h2>温度报警列表</h2>
13
+                    </header>
14
+                    <div>
15
+                        <div class="widget-body no-padding">
16
+                            <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper form-inline no-footer">
17
+                                <div class="dt-toolbar">
18
+                                    <div class="col-xs-12 col-sm-10">
19
+                                        <a class="btn btn-primary btn-sm" ng-click="print()">
20
+                                            <span class="fa fa-print"></span>&nbsp;打&nbsp;印
21
+                                        </a>&emsp;
22
+                                        <label> 仓房名称:&emsp;
23
+                                            <select ng-model="search.cfbm" class="form-control input-sm" 
24
+                                                    ng-options="store.cfbm as store.storehouseName for store in storelist">
25
+                                                <option value="">请选择</option>
26
+                                            </select>&emsp;
27
+                                        </label>
28
+                                        <label>检查日期:<input style="width: 100px;" class="form-control" type="text"
29
+                                                           ng-model="search.searchStartDate" name="searchStartDate" id="startDate"
30
+                                                           onClick="WdatePicker({lang:'zh-cn',maxDate:'#F{$dp.$D(\'endDate\')}'})">
31
+                                            --&nbsp;<input style="width: 100px;" class="form-control" type="text" ng-disabled="isArchive"
32
+                                                           ng-model="search.searchEndDate" name="searchEndDate" id="endDate"
33
+                                                           onClick="WdatePicker({lang:'zh-cn',minDate:'#F{$dp.$D(\'startDate\')}'})">
34
+                                        </label>
35
+                                        <a class="btn btn-default btn-sm" ng-click="loadData()"> <i
36
+                                                class="fa fa-search"></i>&nbsp;查&nbsp;询</a>
37
+                                        <a class="btn btn-default btn-sm" ng-click="emptyTime()"> <i class=""></i>&nbsp;清&nbsp;空</a>
38
+                                    </div>
39
+
40
+
41
+                                    <div class="col-sm-2 col-xs-2 hidden-xs">
42
+                                        <div class="dataTables_length">
43
+                                            <label>每页显示 <select ng-model="pageInfo.pageSize" ng-change="loadData()"
44
+                                                                ng-options="num as num for num in [10,25,50,100]"
45
+                                                                class="form-control input-sm"></select> 条
46
+                                            </label>
47
+                                        </div>
48
+                                    </div>
49
+                                </div>
50
+                                <div id="print">
51
+                                    <table class="table table-striped table-bordered table-hover" width="100%"
52
+                                           border="1" style="border-collapse:collapse;border:none;">
53
+                                        <thead>
54
+                                        <tr>
55
+                                            <th data-class="expand" style="text-align:center;">序号</th>
56
+                                            <th data-class="expand" style="text-align:center;">仓房名称</th>
57
+                                            <th data-class="expand" style="text-align:center;">仓高温</th>
58
+                                            <th data-class="expand" style="text-align:center;">仓低温</th>
59
+                                            <th data-class="expand" style="text-align:center;">平均温度</th>
60
+                                            <th data-class="expand" style="text-align:center;">预警高限</th>
61
+                                            <th data-class="expand" style="text-align:center;">预警低限</th>
62
+                                            <th data-class="expand" style="text-align:center;">报警值</th>
63
+                                            <th data-class="expand" style="text-align:center;">报警日期</th>
64
+                                            <th data-class="expand" style="text-align:center;">类型</th>
65
+                                        </tr>
66
+                                        </thead>
67
+
68
+                                        <tbody>
69
+                                        <tr ng-repeat="warning in pageInfo.list">
70
+                                            <td style="text-align:center;">{{ $index + 1 }}</td>
71
+                                            <td style="text-align:center;">{{ storeHouseCodeObj[warning.ch].storehouseName }}</td>
72
+                                            <td style="text-align:center;">{{ warning.cgw}}</td>
73
+                                            <td style="text-align:center;">{{ warning.cdw}}</td>
74
+                                            <td style="text-align:center;">{{ warning.cAvg }}</td>
75
+                                            <td style="text-align:center;">{{ warning.yjgx}}</td>
76
+                                            <td style="text-align:center;">{{ warning.yjdx}}</td>
77
+                                            <td style="text-align:center;">{{ warning.bjz}}</td>   
78
+                                            <td style="text-align:center;">{{ warning.jcsj | date:'yyyy-MM-dd HH:mm:ss' }}
79
+                                            <td style="text-align:center;" ng-if="warning.jblx == 0">高温报警</td>
80
+                                            <td style="text-align:center;" ng-if="warning.jblx == 1">粮温预警</td>
81
+                                            <td style="text-align:center;" ng-if="warning.jblx == 2">低温报警</td>
82
+                                        </tr>
83
+                                        </tbody>
84
+                                    </table>
85
+                                </div>
86
+                                <div smart-include="app/layout/partials/page.tpl.html"></div>
87
+                            </div>
88
+                        </div>
89
+                    </div>
90
+                </div>
91
+            </article>
92
+        </div>
93
+    </section>
94
+</div>