Przeglądaj źródła

事件列表添加播放录音

seimin 2 lat temu
rodzic
commit
9740470f15
1 zmienionych plików z 26 dodań i 18 usunięć
  1. 26 18
      assets/js/controllers/incident/incidentCtrl.js

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

@@ -1146,24 +1146,32 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1146 1146
     }
1147 1147
     //录音
1148 1148
     $scope.play = function (data) {
1149
-        // console.log($scope.item.callID)
1149
+        console.log(data.callID)
1150 1150
         var modalInstance = $modal.open({
1151 1151
             backdrop: "static",
1152 1152
             templateUrl: 'assets/views/incident/tpl/audio.html',
1153
-            controller: function ($rootScope, $scope, $modalInstance, $sce, $http, api_playservice) {
1154
-                $rootScope.setbusy();
1153
+            controller: function ($rootScope, $scope, $modalInstance, $sce, $http, api_bpm_data) {
1154
+                // $rootScope.setbusy();
1155 1155
                 $scope.datasurl = "";
1156
-                $http({
1157
-                    url: callIp + "/recording/recording?callID=" + data.callID,
1158
-                    method: 'GET',
1159
-                    headers: {},
1160
-                }).success(function (data, status, headers, config) {
1161
-                    $scope.data = {
1162
-                        "name": "视频",
1163
-                        "url": $sce.trustAsResourceUrl("http://" + data.rrpath)
1164
-                    };
1165
-                    $scope.datasurl = data.rrpath;
1166
-                }).error(function (data, status, headers, config) { });
1156
+                api_bpm_data.fetchDataList("callrecord", {idx: 0, sum: 1, callrecord: {callAccept: data.callID}}).then(function(data) {
1157
+                    if(data.status == 200){
1158
+                        data.list = data.list || [];
1159
+                        if(data.list.length){
1160
+                            $scope.audioUrl = $sce.trustAsResourceUrl(callIp+data.list[0].recordingFileName);
1161
+                        }
1162
+                    }
1163
+                });
1164
+                // $http({
1165
+                //     url: callIp + "/recording/recording?callID=" + data.callID,
1166
+                //     method: 'GET',
1167
+                //     headers: {},
1168
+                // }).success(function (data, status, headers, config) {
1169
+                //     $scope.data = {
1170
+                //         "name": "视频",
1171
+                //         "url": $sce.trustAsResourceUrl("http://" + data.rrpath)
1172
+                //     };
1173
+                //     $scope.datasurl = data.rrpath;
1174
+                // }).error(function (data, status, headers, config) { });
1167 1175
                 $scope.download = function (contentId, filename) {
1168 1176
                     $http({
1169 1177
                         url: "http://" + $scope.datasurl,
@@ -1194,12 +1202,12 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1194 1202
                 $modalInstance.close();
1195 1203
 
1196 1204
 
1197
-            }
1205
+            },
1198 1206
         });
1199 1207
         modalInstance.result.then(function (result) {
1200 1208
             // $rootScope.setidle();
1201 1209
         }, function (reason) {
1202
-            $rootScope.setidle();
1210
+            // $rootScope.setidle();
1203 1211
         });
1204 1212
     };
1205 1213
     $scope.jry_paging = "";
@@ -3321,7 +3329,7 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
3321 3329
         console.log($scope.colobject.grid.appScope)
3322 3330
         $scope.colobject.grid.appScope.problem($scope.item)
3323 3331
     }
3324
-    $scope.record = function () { //record
3332
+    $scope.play = function () { //record
3325 3333
         $scope.colobject.grid.appScope.play($scope.item);
3326 3334
         // $scope.doEdit($scope.item.id);
3327 3335
     }
@@ -3400,7 +3408,7 @@ app.directive('incidentoperator', function () {
3400 3408
             // '<a ng-click="cooperate()" ng-show="{{item.state.id==4}}" class="cooperate" >协同</a>' +
3401 3409
             // '<a ng-click="coordination()"  ng-show="{{item.coordination}}" tooltip="添加协同人" tooltip-placement="left"><i  class="icon  iconfont icon-tianjiarenyuan adduserfont"></i></a>' +
3402 3410
             // '<a class="ui-grid-cell-contents" ng-click="grid.appScope.open(row.entity)"  tooltip="打印" tooltip-placement="left"><i class="ti-printer"></i></a>'+
3403
-            // '<a ng-click="grid.appScope.play(row.entity)"ng-if="row.entity.callID"  tooltip="播放录音" tooltip-placement="left"><i class="ti-microphone"></i></a>'+
3411
+            '<a ng-click="play(item)" ng-if="item.callID"  tooltip="播放录音" tooltip-placement="left"><i class="ti-microphone"></i></a>'+
3404 3412
             // '<a ng-click="follow()" tooltip="状态跟踪" tooltip-placement="left"><i class="fa fa-location-arrow"></i></a>'+
3405 3413
             '</div></div>'
3406 3414
     };