Bladeren bron

预警报警顶部导航-初始化

hanqingsong 1 jaar geleden
bovenliggende
commit
c07eabf596

+ 2 - 1
src/main/resources/static/app/app.js

@@ -68,7 +68,8 @@ angular.module('app', [
68 68
     'app.log',
69 69
     'app.additionalHome',
70 70
     'app.registrationTable',
71
-    'app.archive'
71
+    'app.archive',
72
+    'app.warnAndAlarm'
72 73
     //'app.risk',
73 74
     //'app.cstj',
74 75
     //'app.jczcsupervise'

+ 2 - 16
src/main/resources/static/app/business/module.js

@@ -195,20 +195,6 @@ angular.module('app.business')
195 195
                 title: '预警报警'
196 196
             }
197 197
         })
198
-        // 温湿度报警设置
199
-        .state('app.business.warning.temperatureHumidity', {
200
-                url: '/business/warning/temperatureHumidity',
201
-                data: {
202
-                    title: '温湿度报警设置'
203
-                },
204
-                views: {
205
-                    "content@app": {
206
-                        controller: 'tempWarnCtrl',
207
-                        templateUrl: 'app/business/warning/views/tempWarn-list.html'
208
-                    }
209
-                }
210
-            }
211
-        )
212 198
         // 温度报警
213 199
         /*.state('app.business.warning.temperature', {
214 200
                 url: '/business/warning/temperature',
@@ -224,7 +210,7 @@ angular.module('app.business')
224 210
             }
225 211
         )*/
226 212
 		// 湿度报警
227
-        .state('app.business.warning.humidity', {
213
+        /*.state('app.business.warning.humidity', {
228 214
 			url: '/business/warning/humidity',
229 215
 			data: {
230 216
 				title: '湿度报警'
@@ -235,7 +221,7 @@ angular.module('app.business')
235 221
 					templateUrl: 'app/supervise/views/humidityWarningThreshold.html'
236 222
 				}
237 223
 			}
238
-		})
224
+		})*/
239 225
 		// 结露报警
240 226
         .state('app.business.warning.dewing', {
241 227
 			url: '/business/warning/dewing',

+ 7 - 0
src/main/resources/static/app/layout/partials/header.tpl.html

@@ -31,6 +31,7 @@
31 31
 					<a href-void data-slide="prev"><i class="nav-prev"></i></a>
32 32
                     <i class="nav-feng-line"></i>
33 33
 				</div>
34
+				<!--static/styles/css/home/reset-default.css 38 行-->
34 35
 				<div class="carousel-inner">
35 36
 					<!-- Slide 1 -->
36 37
 					<div class="nav-item">
@@ -46,6 +47,12 @@
46 47
 								综合业务</a>
47 48
 							<i class="nav-feng-line"></i>
48 49
 						</div>
50
+						<div has-func="517" ng-hide="isEmergency" class="nav-li" role="presentation" ng-class="{true:'active'}[childSysId==517]">
51
+							<a href-void ng-click="switchTopMenu(517, 'app.warnAndAlarm.temperatureHumidity.threshold')">
52
+								<i class="nav-icon"><img src="styles/img/home-1/nav-icon/zhinaf-icon.png" /></i>
53
+								预警报警</a>
54
+							<i class="nav-feng-line"></i>
55
+						</div>
49 56
 						<div has-func="124" class="nav-li" role="presentation">
50 57
 							<a href="javaScript:void(0)" ng-click="crk()">
51 58
 								<i class="nav-icon"><img src="styles/img/home-1/nav-icon/churk-icon.png" /></i>

+ 29 - 3
src/main/resources/static/app/layout/partials/navigation.tpl.html

@@ -508,9 +508,6 @@
508 508
 							<li has-func="450">
509 509
 								<a data-ui-sref="app.business.warning.humidity">湿度报警</a>
510 510
 							</li>-->
511
-                            <li has-func="301">
512
-                                <a data-ui-sref="app.business.warning.temperatureHumidity">温湿度报警设置</a>
513
-                            </li>
514 511
 							<li has-func="450">
515 512
 								<a data-ui-sref="app.business.warning.dewing">结露预警</a>
516 513
 							</li>
@@ -627,6 +624,35 @@
627 624
 
628 625
                 </ul>
629 626
             </li>
627
+            <!----------------------------------预警报警 start ------------------------------------->
628
+            <li data-menu-collapse id="menu-517" ng-show="childSysId==517">
629
+                <a href="#" style="background: #2259a5 !important">
630
+                    <i class="nav-icon"><img style="margin-bottom: -12px;" src="styles/img/home-1/nav-icon/zhinaf-icon.png"/></i>
631
+                    <span class="menu-item-parent" style="color:#fff;background: #2259a5 !important">预警报警</span>
632
+                </a>
633
+                <!--温湿度 start-->
634
+                <ul>
635
+                    <li data-menu-collapse>
636
+                        <a has-func="518" href="#">
637
+                            <i class="fa fa-fw fa-folder-open"></i>温湿度报警
638
+                        </a>
639
+                        <ul>
640
+                            <li has-func="519">
641
+                                <a data-ui-sref="app.warnAndAlarm.temperatureHumidity.threshold">温湿度报警设置</a>
642
+                            </li>
643
+                            <li has-func="520">
644
+                                <a data-ui-sref="app.warnAndAlarm.temperatureHumidity.humidity">温度报警</a>
645
+                            </li>
646
+                            <li has-func="521">
647
+                                <a data-ui-sref="app.warnAndAlarm.temperatureHumidity.temperature">湿度报警</a>
648
+                            </li>
649
+                        </ul>
650
+                    </li>
651
+                </ul>
652
+                <!--温湿度 end-->
653
+
654
+            </li>
655
+            <!----------------------------------预警报警 end ------------------------------------->
630 656
             <li data-menu-collapse id="menu-17" ng-show="childSysId==17">
631 657
                 <a href="#" style="background: #2259a5;">
632 658
                     <i class="nav-icon"><img style="margin-bottom: -12px;"

+ 67 - 0
src/main/resources/static/app/warnAndAlarm/module.js

@@ -0,0 +1,67 @@
1
+"use strict";
2
+angular.module('app.warnAndAlarm', ['ui.router', 'ui.bootstrap', 'datatables', 'datatables.bootstrap']);
3
+angular.module('app.warnAndAlarm').config(function ($stateProvider) {
4
+    $stateProvider
5
+        .state('app.warnAndAlarm', {
6
+            abstract: true,
7
+            data: {
8
+                title: '预警报警'
9
+            }
10
+        })
11
+        //----------------------温湿度-----------------
12
+        .state('app.warnAndAlarm.temperatureHumidity', {
13
+            abstract: true,
14
+            data: {
15
+                title: '温湿度报警'
16
+            }
17
+        })
18
+        // 温湿度报警设置
19
+        .state('app.warnAndAlarm.temperatureHumidity.threshold', {
20
+                url: '/warnAndAlarm/temperatureHumidity/threshold',
21
+                data: {
22
+                    title: '温湿度报警设置'
23
+                },
24
+                views: {
25
+                    "content@app": {
26
+                        controller: 'tempWarnCtrl',
27
+                        templateUrl: 'app/warnAndAlarm/tempWet/views/tempWarn-list.html'
28
+                    }
29
+                }
30
+            }
31
+        )
32
+        // 温度报警
33
+        .state('app.warnAndAlarm.temperatureHumidity.temperature', {
34
+                url: '/warnAndAlarm/temperatureHumidity/temperature',
35
+                data: {
36
+                    title: '温度报警列表'
37
+                },
38
+                params:{
39
+                    thresholdType : 0,
40
+                    titleName: '温度报警列表'
41
+                },
42
+                views: {
43
+                    "content@app": {
44
+                        controller: 'tempAlarmCtrl',
45
+                        templateUrl: 'app/warnAndAlarm/tempWet/views/tempAlarm-list.html'
46
+                    }
47
+                }
48
+            }
49
+        )
50
+        // 湿度报警
51
+        .state('app.warnAndAlarm.temperatureHumidity.humidity', {
52
+            url: '/warnAndAlarm/temperatureHumidity/humidity',
53
+            data: {
54
+                title: '湿度报警列表'
55
+            },
56
+            params:{
57
+                thresholdType : 1,
58
+                titleName: '湿度报警列表'
59
+            },
60
+            views: {
61
+                "content@app": {
62
+                    controller: 'tempAlarmCtrl',
63
+                    templateUrl: 'app/warnAndAlarm/tempWet/views/tempAlarm-list.html'
64
+                }
65
+            }
66
+        })
67
+});

+ 66 - 0
src/main/resources/static/app/warnAndAlarm/tempWet/controller/tempAlarmCtrl.js

@@ -0,0 +1,66 @@
1
+"use strict";
2
+angular.module('app.warnAndAlarm').controller("tempAlarmCtrl", function ($scope, $rootScope, $state, $stateParams, APP_CONFIG, tempWarnService, $uibModal) {
3
+    // 获取列表数据
4
+    $scope.pageInfo = {pageNum: 1, pageSize: 10};
5
+
6
+    // 初始化查询条件
7
+    $scope.search = {houseId: null, thresholdType: null};
8
+
9
+    // 判断温湿度页面
10
+    $scope.titleName = $stateParams.titleName;
11
+    if ($stateParams.thresholdType) {
12
+        // 湿度列表
13
+        $scope.tempValueTitle = '报警湿度%';
14
+        $scope.thresholdValueTitle = '设置湿度%';
15
+    } else {
16
+        // 温度列表
17
+        $scope.tempValueTitle = '报警温度℃';
18
+        $scope.thresholdValueTitle = '设置温度℃';
19
+    }
20
+
21
+    $scope.loadData = function () {
22
+        $scope.search.thresholdType = $stateParams.thresholdType;
23
+        tempWarnService.getTempAlarmPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $scope.search).then(function (data) {
24
+            $scope.pageInfo = data.data;
25
+        }, function (data) {
26
+            console.log(data);
27
+        });
28
+    };
29
+    $scope.loadData();
30
+
31
+    // 翻页
32
+    $scope.goPage = function (pageNum) {
33
+        $scope.pageInfo.pageNum = pageNum;
34
+        $scope.loadData();
35
+    };
36
+
37
+    $scope.emptyTime = function () {
38
+        $scope.search.houseId = null;
39
+        $scope.loadData();
40
+    };
41
+
42
+    // 检测列表
43
+    $scope.showGrainDetectionList = function (vCfCode) {
44
+        // 初始参数
45
+        var params = [];
46
+        params.vCfCode = vCfCode;
47
+        $uibModal.open({
48
+            size: 'lg',
49
+            templateUrl: 'app/warnAndAlarm/tempWet/views/tempAlarm-modal-list.html',
50
+            controller: 'tempAlarmModalListCtrl',
51
+            resolve: {
52
+                // 传入参数
53
+                items: function () {
54
+                    // 这个值会被模态框的控制器获取到
55
+                    return params;
56
+                }
57
+            }
58
+        });
59
+    };
60
+
61
+    /*
62
+    // 打印
63
+    $scope.print = function () {
64
+        $("#print").printArea();
65
+    };*/
66
+});

+ 70 - 0
src/main/resources/static/app/warnAndAlarm/tempWet/controller/tempAlarmModalListCtrl.js

@@ -0,0 +1,70 @@
1
+"use strict";
2
+angular.module('app.warnAndAlarm').controller("tempAlarmModalListCtrl", function ($scope, $rootScope, $state, $stateParams, tempWarnService, $uibModal, $uibModalInstance, basicThresholdSetService) {
3
+    // org_id,storehouse,t_time,ilq_yq='0'
4
+    $scope.loadData = function () {
5
+        /*$scope.search.thresholdType = $stateParams.thresholdType;
6
+        tempWarnService.getTempAlarmPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $scope.search).then(function (data) {
7
+            $scope.pageInfo = data.data;
8
+        }, function (data) {
9
+            console.log(data);
10
+        });*/
11
+        $scope.pageList = [
12
+            {
13
+                id:'f1f5addeef7b475782d862a8ef17c0b1',
14
+                storehouse:"001",
15
+                time:'2024-10-13 23:00:00',
16
+                intemp:17.1,
17
+                inh:42.9,
18
+                outtemp:11.8,
19
+                outh:52.4,
20
+                max:7.7,
21
+                min:28.2,
22
+                avg:17.2
23
+            }
24
+            ]
25
+    };
26
+    $scope.loadData();
27
+
28
+    // 加载测温预警,报警阀值
29
+    $scope.getWarningValue = function () {
30
+        basicThresholdSetService.getValueByOrgIdOrCfCode().then(function (data) {
31
+            $rootScope.warningValueList = data.data;
32
+        }, function (data) {
33
+            console.log(data);
34
+        });
35
+    };
36
+
37
+    // 查看
38
+    $scope.showView = function(thermometryData) {
39
+        $scope.getWarningValue();
40
+        var params = [];
41
+        params.vCfCode = thermometryData.storehouse; // 仓房编码
42
+        params.time = thermometryData.time; // 检测时间
43
+        params.intemp = thermometryData.intemp; // 仓内温
44
+        params.inh = thermometryData.inh; // 仓内湿
45
+        params.outtemp = thermometryData.outtemp; // 仓外温
46
+        params.outh = thermometryData.outh; // 仓外湿
47
+        params.max = thermometryData.max; // 最高粮温
48
+        params.min = thermometryData.min; // 最低粮温
49
+        params.avg = thermometryData.avg; // 平均粮温
50
+        params.id = thermometryData.id;
51
+        console.log("params", params)
52
+        $uibModal.open({
53
+            size:'lg',
54
+            templateUrl: 'app/intelligent/grainDetection/views/humitureDetection-model.html',
55
+            controller: 'humitureDetectionModel',
56
+            resolve: {
57
+                // 传入参数
58
+                items: function () {
59
+                    // 这个值会被模态框的控制器获取到
60
+                    return params;
61
+                }
62
+            }
63
+        });
64
+    };
65
+
66
+    // 关闭模态窗口
67
+    $scope.cancel = function() {
68
+        $uibModalInstance.close();
69
+    };
70
+});

+ 1 - 1
src/main/resources/static/app/business/warning/controller/tempWarnCtrl.js

@@ -1,5 +1,5 @@
1 1
 "use strict";
2
-angular.module('app.business').controller("tempWarnCtrl", function ($scope, $rootScope, $state, $stateParams, APP_CONFIG, tempWarnService) {
2
+angular.module('app.warnAndAlarm').controller("tempWarnCtrl", function ($scope, $rootScope, $state, $stateParams, APP_CONFIG, tempWarnService) {
3 3
     $scope.pageInfo = {pageNum: 1, pageSize: 10};
4 4
     // 保持在已选类型列表-初始化
5 5
     let flag = 0;

+ 24 - 1
src/main/resources/static/app/business/warning/service/tempWarnService.js

@@ -1,5 +1,5 @@
1 1
 "use strict";
2
-angular.module('app.business').service("tempWarnService", function ($http, $q, APP_CONFIG, $rootScope) {
2
+angular.module('app.warnAndAlarm').service("tempWarnService", function ($http, $q, APP_CONFIG, $rootScope) {
3 3
     this.getPageList = function(pageNum, pageSize, thresholdType) {
4 4
         var d = $q.defer();
5 5
         $http({
@@ -38,4 +38,27 @@ angular.module('app.business').service("tempWarnService", function ($http, $q, A
38 38
         });
39 39
         return d.promise;
40 40
     };
41
+
42
+    // 温湿度报警数据列表
43
+    this.getTempAlarmPageInfo = function(pageNum, pageSize, search) {
44
+        var d = $q.defer();
45
+        $http({
46
+            method : 'GET',
47
+            url : APP_CONFIG.depotStorageUrl + '/tempWetAlarm/getPageList',
48
+            params : {
49
+                pageNum : pageNum,
50
+                pageSize : pageSize,
51
+                orgId : $rootScope.userInfo.orgId,
52
+                houseId: search.houseId,
53
+                thresholdType: search.thresholdType
54
+            }
55
+        }).then(function successCallback(response) {
56
+            // 请求成功执行代码
57
+            d.resolve(response.data);
58
+        }, function errorCallback(response) {
59
+            // 请求失败执行代码
60
+            d.reject("error");
61
+        });
62
+        return d.promise;
63
+    };
41 64
 });

+ 89 - 0
src/main/resources/static/app/warnAndAlarm/tempWet/views/tempAlarm-list.html

@@ -0,0 +1,89 @@
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>{{titleName}}</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
+                                        <label> 仓房名称:&emsp;
20
+                                            <select ng-model="search.houseId" class="form-control input-sm"
21
+                                                    ng-options="store.storehouseId as store.storehouseName for store in storelist">
22
+                                                <option value="">请选择</option>
23
+                                            </select>&emsp;
24
+                                        </label>
25
+                                        <a class="btn btn-default btn-sm" ng-click="loadData()"> <i
26
+                                                class="fa fa-search"></i>&nbsp;查&nbsp;询</a>
27
+                                        <a class="btn btn-default btn-sm" ng-click="emptyTime()"> <i class=""></i>&nbsp;清&nbsp;空</a>
28
+                                        &emsp;
29
+                                        <label style="color: blue;">请登录企业服务平台填写处理情况</label>
30
+                                    </div>
31
+                                    <div class="col-sm-2 col-xs-2 hidden-xs">
32
+                                        <div class="dataTables_length">
33
+                                            <label>每页显示 <select ng-model="pageInfo.pageSize" ng-change="loadData()"
34
+                                                                ng-options="num as num for num in [10,25,50,100]"
35
+                                                                class="form-control input-sm"></select> 条
36
+                                            </label>
37
+                                        </div>
38
+                                    </div>
39
+                                </div>
40
+                                <div id="print">
41
+                                    <table class="table table-striped table-bordered table-hover" width="100%"
42
+                                           border="1" style="border-collapse:collapse;border:none;">
43
+                                        <thead>
44
+                                        <tr>
45
+                                            <th data-class="expand" style="text-align:center;">序号</th>
46
+                                            <th data-class="expand" style="text-align:center;">仓号</th>
47
+                                            <th data-class="expand" style="text-align:center;">粮食性质</th>
48
+                                            <th data-class="expand" style="text-align:center;">粮食品种</th>
49
+                                            <th data-class="expand" style="text-align:center;">{{tempValueTitle}}</th>
50
+                                            <th data-class="expand" style="text-align:center;">{{thresholdValueTitle}}</th>
51
+                                            <th data-class="expand" style="text-align:center;">预警日期</th>
52
+                                            <th data-class="expand" style="text-align:center;">恢复正常时间</th>
53
+                                            <th data-class="expand" style="text-align:center;">持续天数</th>
54
+                                            <th data-class="expand" style="text-align:center;">状态</th>
55
+                                            <th data-class="expand" style="text-align:center;">操作</th>
56
+                                        </tr>
57
+                                        </thead>
58
+
59
+                                        <tbody>
60
+                                        <tr ng-repeat="warning in pageInfo.list">
61
+                                            <td style="text-align:center;">{{ $index + 1 }}</td>
62
+                                            <!--编码翻译:storeHouseCodeObj[cainfo.vcfcode].storehouseName-->
63
+                                            <!--id翻译:storehouseObj[gainCard.storehouseId].storehouseName-->
64
+                                            <td style="text-align:center;">{{ storeHouseCodeObj[warning.houseCode].storehouseName }}</td>
65
+                                            <td style="text-align:center;">{{ dicData[warning.hwxz]}}</td>
66
+                                            <td style="text-align:center;">{{ dicData[warning.pz]}}</td>
67
+                                            <td style="text-align:center;">{{ warning.tempValue }}</td>
68
+                                            <td style="text-align:center;">{{ warning.thresholdValue}}</td>
69
+                                            <td style="text-align:center;">{{ warning.alarmTime}}</td>
70
+                                            <td style="text-align:center;">{{ warning.restoreTime}}</td>
71
+                                            <td style="text-align:center;">{{ warning.durationDays }}</td>
72
+                                            <td style="text-align:center;" >{{ warning.approvalStatus }}</td>
73
+                                            <td style="text-align:center;">
74
+                                                <a href-void ng-click="showGrainDetectionList(warning.id)"><i class=""></i>检测记录</a>&emsp;
75
+                                                <a href-void ng-click="showProcessDetectionList(warning.id)"><i class=""></i>处理记录</a>
76
+                                            </td>
77
+                                        </tr>
78
+                                        </tbody>
79
+                                    </table>
80
+                                </div>
81
+                                <div smart-include="app/layout/partials/page.tpl.html"></div>
82
+                            </div>
83
+                        </div>
84
+                    </div>
85
+                </div>
86
+            </article>
87
+        </div>
88
+    </section>
89
+</div>

+ 34 - 0
src/main/resources/static/app/warnAndAlarm/tempWet/views/tempAlarm-modal-list.html

@@ -0,0 +1,34 @@
1
+<div class="modal-content">
2
+    <div class="modal-header">
3
+        <button type="button" class="close" ng-click="cancel()">
4
+            &times;
5
+        </button>
6
+        <h4 class="modal-title" id="myModalLabel">粮情检测记录</h4>
7
+    </div>
8
+    <div class="modal-body">
9
+        <div class="widget-body no-padding">
10
+            <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper form-inline no-footer">
11
+                <table class="table table-striped table-bordered table-hover" width="100%">
12
+                    <thead>
13
+                    <tr>
14
+                        <th data-class="expand" style="text-align:center;">序号</th>
15
+                        <th data-class="expand" style="text-align:center;">检测记录日期</th>
16
+                        <th data-class="expand" style="text-align:center;">操作</th>
17
+                    </tr>
18
+                    </thead>
19
+
20
+                    <tbody>
21
+                    <tr ng-repeat="temWet in pageList">
22
+                        <td style="text-align:center;">{{ $index + 1 }}</td>
23
+                        <td style="text-align:center;">{{ temWet.time | date:'yyyy-MM-dd HH:mm:ss' }}</td>
24
+                        <td style="text-align:center;">
25
+                            <a href-void ng-click="showView(temWet)"><i class=""></i>查看</a>
26
+                        </td>
27
+                    </tr>
28
+                    </tbody>
29
+                </table>
30
+            </div>
31
+        </div>
32
+    </div>
33
+</div>
34
+

src/main/resources/static/app/business/warning/views/tempWarn-list.html → src/main/resources/static/app/warnAndAlarm/tempWet/views/tempWarn-list.html