userRole.js
3.29 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* Created by cjl on 2018/4/23.
*/
(function () {
"user strict";
var UserRoleController = function($scope,$modal,$http,$interval,dialogService,railwayService){
$scope.$emit('navShow', 7);
$scope.settingShow = 7;
$scope.vm = {
account: '',
totalCount : 0,
pageNumber : 1,
pageSize : 10,
userId : ''
};
$scope.getList = function(){
railwayService.findUserRoleList($scope.vm).success(function(data){
if (data.errors == null || data.errors.length > 0) {
dialogService.tip(data.errors);
}else{
$scope.userRoleList = data.result;
$scope.vm.totalCount = data.totalCount;
}
})
};
$scope.getList();
$scope.doSearch = function(){
$scope.vm.pageNumber = 1;
$scope.getList();
}
};
var AssignRoleController = function($scope,$modal,$http,$interval,dialogService,railwayService){
$scope.$emit('navShow', 7);
$scope.settingShow = 7;
$scope.vm = {
account: '',
totalCount : 0,
pageNumber : 1,
pageSize : 10,
userId : ''
};
//查找商品品牌
$scope.brandOptions = {
pageNumber: 1,
pageSize: 10,
methodName: "getBrandList"
};
$scope.brand = "";
$scope.getBrandList = function (item) {
var param = {
fieldList : ["name"],
value : item.data.keyword,
allList : [
{name:"无印良品1"},
{name:"无印良品2"},
{name:"无印良品3"},
{name:"无印良品4"},
{name:"无印良品5"}
],
pageSize: item.data.pageSize,
pageNumber:item.data.pageNumber
};
var returnValue = $scope.foregroundPaging(param);
$scope.brandList=returnValue.result;
$scope.brandOptions.totalCount = returnValue.totalCount;
item.deferred.resolve({itemList:returnValue.result,totalCount:returnValue.totalCount});
};
$scope.selectBrand = function(brand){
$scope.vm.brandName = brand.name;
$scope.vm.brandId = brand.id;
};
$scope.getList = function(){
railwayService.findUserRoleList($scope.vm).success(function(data){
if (data.errors == null || data.errors.length > 0) {
dialogService.tip(data.errors);
}else{
$scope.userRoleList = data.result;
$scope.vm.totalCount = data.totalCount;
}
})
};
$scope.getList();
$scope.doSearch = function(){
$scope.vm.pageNumber = 1;
$scope.getList();
}
};
angular.module("xn.page", ["xn.directive.form"])
.controller("UserRoleController",["$scope","$modal","$http","$interval","dialogService","RailwayService",UserRoleController])
.controller("AssignRoleController",["$scope","$modal","$http","$interval","dialogService","RailwayService",AssignRoleController])
})();