Commit 91614877 authored by liboyang's avatar liboyang

修改bug

parent 1b4297e6
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
<div class="form-group pull-in clearfix" ng-if="thisUser.username!='admin'"> <div class="form-group pull-in clearfix" ng-if="thisUser.username!='admin'">
<div class="col-sm-6"> <div class="col-sm-6">
<label>角色</label> <label>角色</label>
<select class="form-control w-md" ng-model="roleId" ng-options="role.id as role.role for role in activeRoleList"></select> <select class="form-control w-md" ng-model="thisUser.roleId" ng-options="role.id as role.role for role in activeRoleList"></select>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="ui-dialog-confirm"> <div class="ui-dialog-confirm">
<button type="submit" class="btn btn-info" ng-click="userUpdate(roleId)&&closeThisDialog()">确认修改</button> <button type="submit" class="btn btn-info" ng-click="userUpdate()&&closeThisDialog()">确认修改</button>
</div> </div>
\ No newline at end of file
...@@ -73,13 +73,13 @@ app.controller('userListCtrl', ['$scope','$rootScope', '$http', '$state', '$filt ...@@ -73,13 +73,13 @@ app.controller('userListCtrl', ['$scope','$rootScope', '$http', '$state', '$filt
HttpService.getAllActiveRoleList(function(data) { HttpService.getAllActiveRoleList(function(data) {
$scope.activeRoleList = data; $scope.activeRoleList = data;
}) })
$scope.userUpdate = function(roleId){ $scope.userUpdate = function(){
var jsonUser = {}; var jsonUser = {};
jsonUser.username=$scope.thisUser.username; jsonUser.username=$scope.thisUser.username;
jsonUser.name=$scope.thisUser.name; jsonUser.name=$scope.thisUser.name;
jsonUser.id =$scope.thisUser.id; jsonUser.id =$scope.thisUser.id;
jsonUser.oldRoleId=$scope.thisUser.roleList[0].id; jsonUser.oldRoleId=$scope.thisUser.roleList[0].id;
jsonUser.roleId=roleId; jsonUser.roleId=$scope.thisUser.roleId;
console.log(jsonUser) console.log(jsonUser)
HttpService.updateUser(jsonUser,function(data){ HttpService.updateUser(jsonUser,function(data){
$scope.closeThisDialog(); $scope.closeThisDialog();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment