|
@@ -59,7 +59,6 @@
|
|
|
plain
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
- :disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
>修改</el-button>
|
|
|
</el-col>
|
|
@@ -69,14 +68,13 @@
|
|
|
plain
|
|
|
icon="el-icon-delete"
|
|
|
size="mini"
|
|
|
- :disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
>删除</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<div style="padding-top: 10px">
|
|
|
<vxe-table
|
|
|
- ref="userList"
|
|
|
+ ref="userTable"
|
|
|
align="center"
|
|
|
:loading="loading"
|
|
|
class="mytable-style"
|
|
@@ -88,7 +86,9 @@
|
|
|
show-overflow
|
|
|
max-height="700"
|
|
|
:data="userList"
|
|
|
+ :radio-config="{trigger: 'row'}"
|
|
|
>
|
|
|
+ <vxe-column type="radio" width="60"/>
|
|
|
<vxe-table-column field="username" title="用户账号" />
|
|
|
<vxe-table-column field="nickname" title="用户姓名" />
|
|
|
<vxe-table-column field="mailbox" title="邮箱" />
|
|
@@ -101,7 +101,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleResetPwd(scope.row)"
|
|
|
- >重置密码并且发送邮箱</el-button>
|
|
|
+ >初始/重置密码</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
@@ -240,7 +240,7 @@ export default {
|
|
|
],
|
|
|
nickname: [
|
|
|
{ required: true, message: "用户姓名不能为空", trigger: "blur" },
|
|
|
- { min: 5, max: 20, message: '用户姓名长度必须介于 5 和 20 之间', trigger: 'blur' }
|
|
|
+ { min: 2, max: 20, message: '用户姓名长度必须介于 2 和 20 之间', trigger: 'blur' }
|
|
|
],
|
|
|
mailbox: [
|
|
|
{ required: true, message: "邮箱不能为空", trigger: "blur" },
|
|
@@ -377,13 +377,18 @@ export default {
|
|
|
// mailbox: this.form.mailbox
|
|
|
// }
|
|
|
this.$axios.post('/sysUserController', this.form).then((res) => {
|
|
|
- this.$message.success('新增成功')
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- this.getList();
|
|
|
+ if (res.code==0){
|
|
|
+ this.$message.success('新增成功')
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ if (res.code==1){
|
|
|
+ this.$message.error(res.message)
|
|
|
+ }
|
|
|
this.loading = false
|
|
|
}).catch((error) => {
|
|
|
- console.log(error)
|
|
|
+ this.$message.error(error)
|
|
|
this.loading = false
|
|
|
})
|
|
|
}
|
|
@@ -392,7 +397,7 @@ export default {
|
|
|
},
|
|
|
/** 重置密码按钮操作 */
|
|
|
handleResetPwd(row) {
|
|
|
- this.$confirm('重置密码并发送到邮箱'+row.mailbox, '提示', {
|
|
|
+ this.$confirm('创建密码并发送到邮箱?'+row.mailbox, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
@@ -404,13 +409,52 @@ export default {
|
|
|
if (res.code==0){
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
- message: '重置并发送成功!'
|
|
|
+ message: '创建并发送成功!'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '创建密码失败!'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log(error)
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete() {
|
|
|
+ const _selectData = this.$refs.userTable.getRadioRecord(true)
|
|
|
+ if (_selectData == null){
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择记录!'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$confirm('是否确认删除用户?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ const param = {
|
|
|
+ id: _selectData.id
|
|
|
+ }
|
|
|
+ this.$axios.post('/sysUserController/delUser', param).then((res) => {
|
|
|
+ if (res.code==0){
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
});
|
|
|
+ this.getList();
|
|
|
}
|
|
|
else{
|
|
|
this.$message({
|
|
|
type: 'error',
|
|
|
- message: '重置失败!'
|
|
|
+ message: '删除失败!'
|
|
|
});
|
|
|
}
|
|
|
}).catch((error) => {
|
|
@@ -439,16 +483,6 @@ export default {
|
|
|
handleAuthRole: function(row) {
|
|
|
const userId = row.userId;
|
|
|
this.$router.push("/system/user-auth/role/" + userId);
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const userIds = row.userId || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
|
|
|
- return delUser(userIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
}
|
|
|
}
|
|
|
};
|