1. 名词介绍
- userMgr(人员管理)
- roleCollection (角色容器)
- data (数据)
- id: 0, // 序号
- userName: '', // 用户名
- roleName: '', // 角色名
- moblie: '', // 手机号
- idCard: '', // 身份证
- deptName: '', // 部门名称
- loginName: '', // 登录名
- password:'' // 密码
- count (数量)
- init (初始化)
interface
- deptCollection (部门容器)
- data (数据)
- count (数量)
- init (初始化)
interface
- searchCollection (查询容器)
- params(参数项)
- searchUserName(用户名)
- searchMoblie(手机号码)
- searchRole(角色下拉列表)
- data(数据)
- count(数量)
- selectItem(选择项)
- searchDept(部门下拉列表)
- data(数据)
- count(数量)
- selectItem(选择项)
- _validSearch (验证查询方法)
- OnClickSearch(查询方法)
interface
- userCollection (用户容器)
- data (数据)
- count (数量)
- addUserCollection(添加用户)
- current(当前选择的用户)
- OnResetUser(重置当前用户)
- OnClickAddUser(添加用户)
interface
- editUserCollection(编辑用户)
- current(当前选择的用户)
- OnSettingCurrent(获取当前用户)
- OnClickEditUser (修改当前用户)
interface
- modifyPasswrodCollection(修改密码)
- current(当前选择的用户)
- OnClickModifyPassword (修改密码方法)
interface
- OnClickDeleteUserById(删除用户)
interface
- Init (初始化)
2.功能ViewModel
var ServerUrls = { // 服务器地址
};
$scope.vm={
userMgr:{ // 1.帐号管理之人员管理
},
roleMgr:{ // 2.帐号管理角色管理
}
};
$scope.vm.userMgr = {
roleCollection:{
data:[],
count: 0,
Init: function(){
}
},
deptCollection:{
data:[],
count: 0,
Init: function(){
}
},
searchCollection:{ // 1. 查询原型
params: { // 1.1 题库查询条件
searchUserName:'',
searchMoblie:'',
searchRole:{
data:[],
count: 0,
selectItem: ''
},
searchDept:{
data:[],
count: 0,
selectItem: ''
}
},
_validSearch: function(){
return true;
},
OnClickSearch:function(){
var self = $scope.vm.userMgr.searchCollection;
if(self._validSearch()){
// 请求查询
}
}
},
userCollection:{
data:[
id: 0,
userName: '',
roleName: '',
moblie: '',
idCard: '',
deptName: '',
loginName: ''
],
count: 0,
addUserCollection:{
current:{
id: 0,
userName: '',
roleName: '',
moblie: '',
idCard: '',
deptName: '',
loginName: '',
password:'',
addRole:{
data:[],
count: 0,
selectItem: ''
},
addDept:{
data:[],
count: 0,
selectItem: ''
}
},
OnResetUser: function(){
},
OnClickAddUser: function(){
var self = $scope.vm.userMgr.userCollection.addUserCollection;
// 保存之后重置
self.OnResetUser();
}
},
editUserCollection:{
current:{
id: 0,
userName: '',
roleName: '',
moblie: '',
idCard: '',
deptName: '',
loginName: '',
password:'',
addRole:{
data:[],
count: 0,
selectItem: ''
},
addDept:{
data:[],
count: 0,
selectItem: ''
}
},
OnSettingCurrent:function(){
},
OnClickEditUser: function(){
var self = $scope.vm.userMgr.userCollection.addUserCollection;
}
},
modifyPasswrodCollection:{
current:{
id: 0,
userName: '',
oldPassword:'',
newPassword1: '',
newPassword2:''
},
OnClickModifyPassword: function(){
var self = $scope.vm.userMgr.userCollection.addUserCollection;
}
},
OnClickDeleteUserById: function(item){
}
},
Init: function(){
var role = $scope.vm.userMgr.roleCollection,
dept = $scope.vm.userMgr.deptCollection;
role.Init();
dept.Init();
}
};