addRoleCtrl.js
1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(function(angular) {
function addRoleCtrl($scope, $uibModalInstance,param, systemService, $uibModal, $filter, $state) {
$scope.selectedList = [];
$scope.condition = {};
$scope.dtInstance = {};
$scope.dtOption = {
id: 'id',
selectingList: {
data: $scope.selectingList,
columns: [{
prop: 'name',
title: '角色',
width: 120,
ellipsis: false
}]
},
selectedList: {
data: $scope.selectedList,
columns: [{
prop: 'name',
title: '角色',
width: 120,
ellipsis: false
}]
}
};
systemService.getCreatedRoleList(function (res) {
if (res.data) {
$scope.selectingList = res.data;
$scope.dtOption.selectingList.data = $scope.selectingList;
}
})
if(param){
for (var i in param) {
$scope.selectedList.push(param[i]);
}
}
$scope.query = function () {
var and = {};
$scope.dtInstance.search(and, {
id: $scope.condition.name,
name: $scope.condition.name
});
}
$scope.ok = function () {
$uibModalInstance.close($scope.dtInstance.getSelectedList());
};
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
};
}
angular.module('system').controller('addRoleCtrl', addRoleCtrl)
})(angular);