| | |
| | | /** 修改用户状态 */ |
| | | updateUserStatus(){ |
| | | let list = this.selectionList; |
| | | if(func.isEmpty(list)){ |
| | | if(list.length < 1){ |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请至少选择一条用户数据!" |
| | |
| | | } |
| | | let userIds = func.joinedString(list,"id"); |
| | | let status = list[0].userStatus == 1 ? true:false; |
| | | updateUserStatus(userIds,status).then(res=>{ |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.onLoad(this.page); |
| | | let msg = status ? "确定将选择账号启用":"确定将选择账号停用"+"?"; |
| | | console.log(msg); |
| | | this.$confirm(msg, { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return updateUserStatus(userIds,status); |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | duration: 1000,// 设置消息显示3秒后自动关闭 |
| | | onClose: () => { |
| | | // 在消息关闭时重新加载数据 |
| | | this.onLoad(this.page); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | //esc取消键操作 |
| | | /*handleClose(done) { |