add risk merchants html

master
yuan 6 years ago
parent 5105bdc6d2
commit 189e37f2a0

@ -45,6 +45,10 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
});
}]
}
}).state('analysis_monitoring.attention', {
url: '/risk/attention',
templateUrl: '/static/risk/templates/attention_merchants.html',
controller: 'AttentionMerchantCtrl'
});
}]);
app.controller('RiskManageCtrl', ['$scope', '$http', function ($scope, $http){
@ -218,6 +222,41 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}
}]);
app.controller('AttentionMerchantCtrl', ['$scope', '$http','commonDialog','$uibModal', function ($scope, $http,commonDialog,$uibModal){
$scope.params = {};
$scope.pagination = {};
$scope.ctrl = {};
$scope.loadAttentionMerchants = function (page) {
var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/sys/risk/attention', {params: params}).then(function (resp) {
$scope.attentions = resp.data.data;
$scope.pagination = resp.data.pagination;
$scope.ctrl.addAttention = false;
});
};
$scope.loadAttentionMerchants(1);
$scope.disableAttention = function (client_moniker) {
commonDialog.confirm({title: 'Confirm', content: '确定删除这个商户?'
}).then(function () {
$http.put('/sys/risk/attention/' + client_moniker).then(function () {
commonDialog.alert({title: 'Success', content: 'disable successfully', type: 'success'});
$scope.loadAttentionMerchants(1);
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
});
})
};
$scope.addAttentionMerchants = function (client_moniker) {
$http.post('/sys/risk/attention/'+ client_moniker).then(function () {
commonDialog.alert({title: 'Success', content: 'add successfully', type: 'success'});
$scope.loadAttentionMerchants(1);
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
});
}
}]);
app.filter('risk_type', function () {
return function (riskStr) {
angular.forEach(riskType,function (type) {

@ -34,6 +34,10 @@
<button class="btn btn-primary" type="button" ng-click="loadRecords(1)"><i
class="fa fa-search"></i></button>
</div>
<div class="form-group pull-right">
<button class="btn btn-primary" type="button" ui-sref="analysis_monitoring.attention">Risky Merchants</button>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save