新增userUsername选择
This commit is contained in:
parent
dafe30a358
commit
7b4cad2d58
@ -135,7 +135,7 @@
|
|||||||
} else {
|
} else {
|
||||||
avatarDom = '<img class="user-avatar" src="route/file/downloadfile/false/'+ item.userAvatar +'"/> ';
|
avatarDom = '<img class="user-avatar" src="route/file/downloadfile/false/'+ item.userAvatar +'"/> ';
|
||||||
}
|
}
|
||||||
userDom += '<a id="user_'+ item.userId +'" href="javascript:void(0);" class="users list-group-item '+ (isUserSelected(item.userId) ? 'user-selected' : '') +'" lay-click-user data-userid="'+ item.userId +'" data-username="'+ item.userName +'">'+ avatarDom + item.userName +' ['+ item.userUsername +']</a>';
|
userDom += '<a id="user_'+ item.userId +'" href="javascript:void(0);" class="users list-group-item '+ (isUserSelected(item.userId) ? 'user-selected' : '') +'" lay-click-user data-userid="'+ item.userId +'" data-username="'+ item.userName +'" data-user-username="'+ item.userUsername +'">'+ avatarDom + item.userName +' ['+ item.userUsername +']</a>';
|
||||||
}
|
}
|
||||||
$('#userWrapper').append(userDom);
|
$('#userWrapper').append(userDom);
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@
|
|||||||
} else {
|
} else {
|
||||||
avatarDom = '<img class="user-avatar" src="route/file/downloadfile/false/'+ item.userAvatar +'"/> ';
|
avatarDom = '<img class="user-avatar" src="route/file/downloadfile/false/'+ item.userAvatar +'"/> ';
|
||||||
}
|
}
|
||||||
userDom += '<a id="user_'+ item.userId +'" href="javascript:void(0);" class="users search-users list-group-item '+ (isUserSelected(item.userId) ? 'user-selected' : '') +'" lay-click-user data-userid="'+ item.userId +'" data-username="'+ item.userName +'">'+ avatarDom + item.userName +' ['+ item.userUsername +']</a>';
|
userDom += '<a id="user_'+ item.userId +'" href="javascript:void(0);" class="users search-users list-group-item '+ (isUserSelected(item.userId) ? 'user-selected' : '') +'" lay-click-user data-userid="'+ item.userId +'" data-username="'+ item.userName +'" data-user-username="'+ item.userUsername +'">'+ avatarDom + item.userName +' ['+ item.userUsername +']</a>';
|
||||||
}
|
}
|
||||||
$('#userWrapper').append(userDom);
|
$('#userWrapper').append(userDom);
|
||||||
}
|
}
|
||||||
@ -221,9 +221,10 @@
|
|||||||
selectedUserIds: selectedUserIds
|
selectedUserIds: selectedUserIds
|
||||||
}, null, function(code, data) {
|
}, null, function(code, data) {
|
||||||
for(var i = 0, item; item = data[i++]; ) {
|
for(var i = 0, item; item = data[i++]; ) {
|
||||||
selectUser(item.userId, item.userName);
|
selectUser(item.userId, item.userName, item.userUsername);
|
||||||
selectDepartmentUserOldArray.push({
|
selectDepartmentUserOldArray.push({
|
||||||
userId: item.userId,
|
userId: item.userId,
|
||||||
|
userUsername: item.userUsername,
|
||||||
userName: item.userName
|
userName: item.userName
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -285,11 +286,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 选择人员
|
// 选择人员
|
||||||
function selectUser(userId, userName, isOnlySelect) {
|
function selectUser(userId, userName, userUsername, isOnlySelect) {
|
||||||
if(!isUserSelected(userId)) {
|
if(!isUserSelected(userId)) {
|
||||||
$('#user_'+ userId).addClass('user-selected');
|
$('#user_'+ userId).addClass('user-selected');
|
||||||
selectDepartmentUserArray.push({
|
selectDepartmentUserArray.push({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
|
userUsername: userUsername,
|
||||||
userName: userName
|
userName: userName
|
||||||
});
|
});
|
||||||
$('#selectUsers').append('<a id="selected_user_'+ userId +'" href="javascript:void(0);" class="layui-btn layui-btn-xs">'+ userName +' <i class="fa fa-close" lay-click-removeuser data-userid="'+ userId +'"></i></a>');
|
$('#selectUsers').append('<a id="selected_user_'+ userId +'" href="javascript:void(0);" class="layui-btn layui-btn-xs">'+ userName +' <i class="fa fa-close" lay-click-removeuser data-userid="'+ userId +'"></i></a>');
|
||||||
@ -302,7 +304,7 @@
|
|||||||
}
|
}
|
||||||
$(document.body).on('click', '*[lay-click-user]', null, function() {
|
$(document.body).on('click', '*[lay-click-user]', null, function() {
|
||||||
var data = this.dataset;
|
var data = this.dataset;
|
||||||
selectUser(data.userid, data.username);
|
selectUser(data.userid, data.username, data.userUsername);
|
||||||
});
|
});
|
||||||
$(document.body).on('click', '*[lay-click-removeuser]', null, function() {
|
$(document.body).on('click', '*[lay-click-removeuser]', null, function() {
|
||||||
var data = this.dataset;
|
var data = this.dataset;
|
||||||
@ -311,7 +313,7 @@
|
|||||||
$(document.body).on('click', '*[lay-click-select-all-user]', null, function() {
|
$(document.body).on('click', '*[lay-click-select-all-user]', null, function() {
|
||||||
$('#userWrapper').children().each(function() {
|
$('#userWrapper').children().each(function() {
|
||||||
var data = this.dataset;
|
var data = this.dataset;
|
||||||
selectUser(data.userid, data.username, true);
|
selectUser(data.userid, data.username, data.userUsername, true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$(document.body).on('click', '*[lay-click-clear-all-user]', null, function() {
|
$(document.body).on('click', '*[lay-click-clear-all-user]', null, function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user