2 Ревизии c208b0048a ... adabec0d18

Автор SHA1 Съобщение Дата
  maopixin adabec0d18 Merge branch 'master' of http://101.36.160.140:21044/depot-tianjin/depot-web-tianjin преди 2 години
  maopixin d96331a3b9 feat: 法律规章信息库 преди 2 години

+ 48 - 33
src/main/resources/static/app/storage/controller/ruleLibraryCtrl.js

@@ -1,13 +1,12 @@
1 1
 "use strict";
2 2
 
3
-angular.module('app.storage').controller("rulelibraryCtrl", function($scope,safeProduceNotifyService,$state, $http,$rootScope, $stateParams, APP_CONFIG) {
4
-    //安全生产通告列表
3
+angular.module('app.storage').controller("rulelibraryCtrl", function($scope,lawRegulationInfoService,$state, $http,$rootScope, $stateParams, APP_CONFIG, $uibModal) {
4
+	
5
+    //获取数据
5 6
     $scope.pageInfo = {pageNum : 1, pageSize : 10};
6
-    $scope.search = {fileName:""};
7 7
     $scope.loadData = function() {
8
-        safeProduceNotifyService.getPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize,$scope.search.fileName)
9
-            .then(function(data){
10
-            $scope.pageInfo = data;
8
+        lawRegulationInfoService.getPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize).then(function(data){
9
+            $scope.pageInfo = data.data;
11 10
         },function(data){
12 11
             console.log(data);
13 12
         });
@@ -21,34 +20,50 @@ angular.module('app.storage').controller("rulelibraryCtrl", function($scope,safe
21 20
         $scope.loadData();
22 21
     };
23 22
 
24
-    // 显示增加页面
25
-    $scope.showAddNotify=function () {
26
-        $state.go('app.storage.safeproduce.safeleveledit', {id:0,isNotEdit:false,topRow:$rootScope.orgInfo.orgName+"通告:\n"});
27
-    };
28
-    //修改编辑页面
29
-    $scope.showEditNotify = function (id) {
30
-        $state.go('app.storage.safeproduce.safeleveledit', {id:id,isNotEdit:false});
31
-    };
32
-    // 查看页面
33
-    $scope.showViewNotify = function(id) {
34
-        $state.go('app.storage.safeproduce.safeleveledit', {id:id,isNotEdit:true});
35
-    };
36
-
37
-    // 根据id删除信息
38
-    $scope.removeNotify = function(id) {
39
-        if (!confirm("确定要删除吗?")) {
40
-            return;
41
-        }
42
-        safeProduceNotifyService.removeById(id).then(function (data) {
43
-            if(data.status == "success"){
44
-                alert("删除成功");
45
-                $scope.loadData();
46
-            }else{
47
-                alert("删除失败");
23
+	// 预览
24
+    $scope.preview = function (info) {
25
+        var uibModalInstance = $uibModal.open({
26
+            size: 'md',
27
+            templateUrl: 'app/storage/views/safeproduce/ruleLibraryView.html',
28
+	        controller : 'ruleLibraryViewCtrl',
29
+            resolve: {
30
+                info: info,
31
+                type: function () {
32
+                    return $stateParams.type;
33
+                }
48 34
             }
49 35
         });
50
-    }
51
-    
52
-});
36
+    };
37
+
38
+	$scope.download = function(id) {
39
+		var url =  APP_CONFIG.depotStorageUrl + '/lawRegulationInfo/download?fileId=' + id
40
+		window.open(url)
41
+	}
42
+}).filter('systype', function() {
43
+	return function(value) {
44
+		if (value) {
45
+			var typeList = [
46
+				{
47
+					value: 1,
48
+					label: '法律法规',
49
+				},
50
+				{
51
+					value: 2,
52
+					label: '行业规定',
53
+				},
54
+				{
55
+					value: 3,
56
+					label: '相关标准',
57
+				},
58
+			]
59
+			for (var i = 0; i < typeList.length; i++) {
60
+				var e = typeList[i];
61
+				if(e.value == value) {
62
+					return e.label
63
+				}
64
+			}
65
+		}
66
+	}
67
+})
53 68
 
54 69
 

+ 42 - 0
src/main/resources/static/app/storage/controller/ruleLibraryViewCtrl.js

@@ -0,0 +1,42 @@
1
+"use strict";
2
+
3
+angular.module('app.storage').controller("ruleLibraryViewCtrl", function($scope,lawRegulationInfoService,$state, $http,$rootScope, $stateParams, APP_CONFIG, $uibModalInstance, info) {
4
+    $scope.info = info
5
+
6
+	// 关闭模态窗口
7
+	$scope.cancel = function() {
8
+		$uibModalInstance.close();
9
+	}
10
+	// 下载
11
+	$scope.download = function(id) {
12
+		var url =  APP_CONFIG.depotStorageUrl + '/lawRegulationInfo/download?fileId=' + id
13
+		window.open(url)
14
+	}
15
+}).filter('systype', function() {
16
+	return function(value) {
17
+		if (value) {
18
+			var typeList = [
19
+				{
20
+					value: 1,
21
+					label: '法律法规',
22
+				},
23
+				{
24
+					value: 2,
25
+					label: '行业规定',
26
+				},
27
+				{
28
+					value: 3,
29
+					label: '相关标准',
30
+				},
31
+			]
32
+			for (var i = 0; i < typeList.length; i++) {
33
+				var e = typeList[i];
34
+				if(e.value == value) {
35
+					return e.label
36
+				}
37
+			}
38
+		}
39
+	}
40
+})
41
+
42
+

+ 22 - 0
src/main/resources/static/app/storage/service/lawRegulationInfoService.js

@@ -0,0 +1,22 @@
1
+"use strict";
2
+
3
+angular.module('app.storage').service("lawRegulationInfoService", function($http, $q, APP_CONFIG) {
4
+    this.getPageInfo = function(pageNum, pageSize){
5
+        var d = $q.defer();
6
+        $http({
7
+            method : 'GET',
8
+            url : APP_CONFIG.depotStorageUrl + '/lawRegulationInfo/getLawRegulationInfo',
9
+            params : {
10
+                pageNum : pageNum,
11
+                pageSize : pageSize,
12
+            }
13
+        }).then(function successCallback(response) {
14
+            // 请求成功执行代码
15
+            d.resolve(response.data);
16
+        }, function errorCallback(response) {
17
+            // 请求失败执行代码
18
+            d.reject("error");
19
+        });
20
+        return d.promise;
21
+    }
22
+})

+ 15 - 30
src/main/resources/static/app/storage/views/safeproduce/ruleLibrary.html

@@ -8,32 +8,16 @@
8 8
                 <div jarvis-widget id="standard-datatable-widget" data-widget-color="darken" data-widget-editbutton="false">
9 9
                     <header>
10 10
                         <span class="widget-icon"> <i class="fa fa-table"></i> </span>
11
-                        <h2>安全风险分级管控</h2>
11
+                        <h2>法律规章信息库</h2>
12 12
                     </header>
13 13
                     <div>
14 14
                         <div class="widget-body no-padding">
15 15
                             <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper form-inline no-footer">
16 16
                                 <div class="dt-toolbar">
17 17
                                     <div class="col-xs-3 col-sm-1">
18
-                                        <a has-permission="578" href-void class="btn btn-primary btn-sm" ng-click="showAddNotify()"><i class="fa fa-plus"></i>&nbsp;新&nbsp;增</a>
19 18
                                     </div>
20 19
                                     <div class="col-xs-12 col-sm-6">
21
-                                        <div class="form-group">
22
-                                            <label> 
23
-                                                出入库日期:
24
-                                                <input style="width: 100px;" class="form-control" type="text"
25
-                                                           ng-model="search.searchStartDate" name="searchStartDate" id="startDate"
26
-                                                           onClick="WdatePicker({lang:'zh-cn',maxDate:'#F{$dp.$D(\'endDate\')}'})">
27
-                                            --&nbsp;<input style="width: 100px;" class="form-control" type="text" ng-disabled="isArchive"
28
-                                                           ng-model="search.searchEndDate" name="searchEndDate" id="endDate"
29
-                                                           onClick="WdatePicker({lang:'zh-cn',minDate:'#F{$dp.$D(\'startDate\')}'})">
30
-                                                <!-- <input type="text" class="form-control" ng-model="search.beginDate" size="10" data-smart-datepicker> - 
31
-                                                <input type="text" class="form-control" ng-model="search.endDate" size="10" data-smart-datepicker> -->
32
-                                            </label>
33
-                                            
34
-                                            <a class="btn btn-default btn-sm" ng-click="loadData()">
35
-                                                <i class="fa fa-search"></i>&nbsp;查&nbsp;询</a>
36
-                                        </div>
20
+                                        
37 21
                                     </div>
38 22
                                     <div class="col-sm-5 col-xs-6 hidden-xs">
39 23
                                         <div class="dataTables_length" id="DataTables_Table_8_length">
@@ -48,22 +32,23 @@
48 32
                                 <table class="table table-striped table-bordered table-hover" width="100%">
49 33
                                     <thead>
50 34
                                     <tr>
51
-                                        <th data-hide="expand">文件名称</th>
52
-                                        <th data-class="expand">类别</th>
53
-                                        <th data-class="expand">下发时间</th>
54
-                                        <th data-hide="expand">来源</th>
55
-                                        <th data-hide="expand">操作</th>
35
+                                        <th style="text-align:center;" data-hide="expand">文件名称</th>
36
+                                        <th style="text-align:center;" data-class="expand">类别</th>
37
+                                        <th style="text-align:center;" data-class="expand">下发时间</th>
38
+                                        <th style="text-align:center;" data-hide="expand">来源</th>
39
+                                        <th style="text-align:center;" data-hide="expand">操作</th>
56 40
                                     </tr>
57 41
                                     </thead>
58 42
 
59 43
                                     <tbody>
60
-                                    <tr ng-repeat="safeProduceNotify in pageInfo.list">
61
-                                        <td align="center">{{$index + 1 + (pageInfo.pageNum-1) * pageInfo.pageSize}}</th>
62
-                                        <td>{{safeProduceNotify.fileName}}</td>
63
-                                        <td>{{safeProduceNotify.operationTime | date:'yyyy-MM-dd'}}</td>
64
-                                        <td>市平台</td>
65
-                                        <td>
66
-                                            <a has-permission="579" href-void ng-click="showViewNotify(safeProduceNotify.id)"><i class="fa fa-info-circle"></i>查看</a>
44
+                                    <tr ng-repeat="item in pageInfo.list">
45
+                                        <td style="text-align:center;">{{item.filename}}</td>
46
+                                        <td style="text-align:center;">{{item.sys_type | systype }}</td>
47
+                                        <td style="text-align:center;">{{item.upload_time}}</td>
48
+                                        <td style="text-align:center;">市平台</td>
49
+                                        <td style="text-align:center;">
50
+                                            <a has-permission="466" class="btn btn-xs btn-default no-margin" href-void="" ng-click="preview(item)" href="#"><i class="fa fa-edit"></i>查看</a>
51
+											<a has-permission="467" class="btn btn-xs btn-default no-margin" href-void="" ng-click="download(item.file_id)" href="#"><i class="fa fa-download"></i>下载</a>
67 52
                                         </td>
68 53
                                     </tr>
69 54
                                     </tbody>

+ 53 - 0
src/main/resources/static/app/storage/views/safeproduce/ruleLibraryView.html

@@ -0,0 +1,53 @@
1
+<div class="modal-content">
2
+	<div class="modal-header">
3
+		<button type="button" class="close" ng-click="cancel()">&times;</button>
4
+		<h4 class="modal-title" id="myModalLabel">法律规章文件查看</h4>
5
+	</div>
6
+	<div class="modal-body">
7
+		<form class="form-horizontal ng-pristine ng-valid">
8
+		    <fieldset>
9
+		    	<div class="form-group">
10
+			        <label class="col-md-2 control-label">文件名称</label>
11
+			        <div class="col-md-10">
12
+			            <input class="form-control" type="text" ng-model="info.filename" readonly="">
13
+			        </div>
14
+			    </div>
15
+		    	<div class="form-group">
16
+			        <label class="col-md-2 control-label">
17
+			        	<span>相关附件</span>
18
+			        </label>
19
+			        <div class="col-md-6">
20
+			            <input class="form-control" type="text" ng-model="info.filename" readonly="">
21
+			        </div>
22
+			        <div class="col-md-4">
23
+                        <a class="btn btn-default" href-void ng-click="download(info.file_id)"><i class="fa fa-download"></i>下载</a>
24
+			        </div>
25
+			    </div>
26
+				<div class="form-group">
27
+			        <label class="col-md-2 control-label">类别</label>
28
+			        <div class="col-md-10">
29
+			            <input class="form-control" type="text" value="{{ info.sys_type | systype }}" readonly="">
30
+			        </div>
31
+			    </div>
32
+		    	<div class="form-group">
33
+			        <label class="col-md-2 control-label">上传时间</label>
34
+			        <div class="col-md-10">
35
+			            <input class="form-control" type="text" value="{{ info.upload_time | date:'yyyy-MM-dd HH:mm:ss'}}" readonly="">
36
+			        </div>
37
+			    </div>
38
+		    	<div class="form-group">
39
+			        <label class="col-md-2 control-label">上传人</label>
40
+			        <div class="col-md-10">
41
+			            <input class="form-control" type="text" ng-model="info.upload_user" readonly="">
42
+			        </div>
43
+			    </div>
44
+		    </fieldset>
45
+		</form>
46
+	</div>
47
+	<div class="modal-footer">
48
+		<button ng-click="cancel()" type="button" class="btn btn-default">关闭</button>
49
+	</div>
50
+	<form id="download-form" method="post" target="_blank">
51
+		<input type="hidden" name="filePath" id="filePath">
52
+	</form>
53
+</div>

+ 2 - 2
src/main/resources/static/app/supervise/controller/violationDetailCtrl.js

@@ -42,11 +42,11 @@ angular.module('app.supervise')
42 42
 					$scope.form.orgId = $rootScope.orgInfo.orgId
43 43
 					$scope.form.disposeTime = $("input[name='disposeTime']").val(); // 时间控件获取值
44 44
 					violationWarningAlarmService.updateWarningInfo($scope.form).then(function(data){
45
-						if (data.status == 'success') {
45
+						if (data.message == 'success') {
46 46
 							alert("保存成功!");
47 47
 							$scope.retList();
48 48
 						} else {
49
-							alert(data.msg);
49
+							alert(data.message);
50 50
 							$scope.saveFlag = false;
51 51
 						}
52 52
 					},function(data){