用户信息修改制定字段
This commit is contained in:
parent
5e3d6a3c84
commit
8492d1f2b6
@ -111,7 +111,7 @@ namespace ZR.Repository.System
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除用户
|
/// 删除用户(物理删除)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userid">用户id</param>
|
/// <param name="userid">用户id</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
@ -125,26 +125,25 @@ namespace ZR.Repository.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改用户信息
|
/// 修改用户信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sysUser"></param>
|
/// <param name="user"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int UpdateUser(SysUser user)
|
public int UpdateUser(SysUser user)
|
||||||
{
|
{
|
||||||
return Context.Updateable(user)
|
return Context.Updateable(user)
|
||||||
//.SetColumns(t => new SysUser()
|
.UpdateColumns(t => new
|
||||||
//{
|
{
|
||||||
// UserName = user.UserName,
|
t.NickName,
|
||||||
// Status = user.Status,
|
t.Email,
|
||||||
// NickName = user.NickName,
|
t.Phonenumber,
|
||||||
// Remark = user.Remark,
|
t.DeptId,
|
||||||
// Email = user.Email,
|
t.Status,
|
||||||
// Update_by = user.Update_by,
|
t.Sex,
|
||||||
// Phonenumber = user.Phonenumber,
|
t.PostIds,
|
||||||
// Update_time = DateTime.Now,
|
t.Remark,
|
||||||
// Sex = user.Sex,
|
t.Update_by,
|
||||||
// DeptId = user.DeptId
|
t.Update_time
|
||||||
//})
|
})
|
||||||
.IgnoreColumns(ignoreAllNullColumns: true)//忽略所有为null
|
.IgnoreColumns(ignoreAllNullColumns: true)//忽略所有为null
|
||||||
.IgnoreColumns(it => new { it.Password, it.Avatar })
|
|
||||||
.Where(f => f.UserId == user.UserId).ExecuteCommand();
|
.Where(f => f.UserId == user.UserId).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,9 +60,9 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="用户编号" align="center" prop="userId" width="80" />
|
<el-table-column label="编号" align="center" prop="userId" width="60" />
|
||||||
<el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
<el-table-column label="登录名" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="用户昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
|
<el-table-column label="昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="头像" prop="avatar">
|
<el-table-column label="头像" prop="avatar">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-image :src="scope.row.avatar" :preview-src-list="[scope.row.avatar]"></el-image>
|
<el-image :src="scope.row.avatar" :preview-src-list="[scope.row.avatar]"></el-image>
|
||||||
@ -82,10 +82,12 @@
|
|||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="创建人" align="center" prop="createBy" v-if="columns[2].checked"></el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[3].checked"></el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope" v-if="scope.row.userId !== 1 | scope.row.userName != 'admin'">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
|
||||||
<el-button v-if="scope.row.userId !== 1 | scope.row.userName != 'admin'" size="mini" type="text" icon="el-icon-delete"
|
<el-button size="mini" type="text" icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
|
@click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['system:user:resetPwd']">重置
|
<el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['system:user:resetPwd']">重置
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -304,6 +306,8 @@ export default {
|
|||||||
// { key: 6, label: `创建时间`, checked: true },
|
// { key: 6, label: `创建时间`, checked: true },
|
||||||
{ key: 0, label: `登录IP`, checked: false },
|
{ key: 0, label: `登录IP`, checked: false },
|
||||||
{ key: 1, label: `最后登录时间`, checked: false },
|
{ key: 1, label: `最后登录时间`, checked: false },
|
||||||
|
{ key: 2, label: `创建人`, checked: false },
|
||||||
|
{ key: 3, label: `备注`, checked: false },
|
||||||
],
|
],
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
@ -463,6 +467,10 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
if(row.userId !== 1 | row.userName != 'admin'){
|
||||||
|
this.msgError("不能对管理进行修改")
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
const userId = row.userId || this.ids;
|
const userId = row.userId || this.ids;
|
||||||
@ -488,7 +496,6 @@ export default {
|
|||||||
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改用户";
|
this.title = "修改用户";
|
||||||
console.log(this.form.roleIds);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 重置密码按钮操作 */
|
/** 重置密码按钮操作 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user