|
|
@ -1,15 +1,23 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<anji-crud ref="listPage" :option="crudOption">
|
|
|
|
<anji-crud ref="listPage" :option="crudOption">
|
|
|
|
<template v-slot:buttonLeftOnTable>
|
|
|
|
<template v-slot:buttonLeftOnTable> </template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template slot="rowButton" slot-scope="props">
|
|
|
|
<template slot="rowButton" slot-scope="props">
|
|
|
|
<el-button type="text" @click="handleOpenDialogSetRoleForUser(props)" v-permission="'userManage:grantRole'">分配角色</el-button>
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
@click="handleOpenDialogSetRoleForUser(props)"
|
|
|
|
|
|
|
|
v-permission="'userManage:grantRole'"
|
|
|
|
|
|
|
|
>分配角色</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
<!--<el-button type="text" @click="handleOpenDialogSetRoleForUser(props)" v-permission="'userManage:resetPassword'">重置密码</el-button>-->
|
|
|
|
<!--<el-button type="text" @click="handleOpenDialogSetRoleForUser(props)" v-permission="'userManage:resetPassword'">重置密码</el-button>-->
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<!--自定义的卡片插槽,将在编辑详情页面,出现在底部新卡片-->
|
|
|
|
<!--自定义的卡片插槽,将在编辑详情页面,出现在底部新卡片-->
|
|
|
|
<template v-slot:pageSection>
|
|
|
|
<template v-slot:pageSection>
|
|
|
|
<UserRole :login-name="loginName" :visib="dialogVisibleSetRoleForUser" @handleClose="dialogVisibleSetRoleForUser = false" />
|
|
|
|
<UserRole
|
|
|
|
|
|
|
|
:login-name="loginName"
|
|
|
|
|
|
|
|
:visib="dialogVisibleSetRoleForUser"
|
|
|
|
|
|
|
|
@handleClose="dialogVisibleSetRoleForUser = false"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</anji-crud>
|
|
|
|
</anji-crud>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
@ -19,112 +27,115 @@ import {
|
|
|
|
accessUserAdd,
|
|
|
|
accessUserAdd,
|
|
|
|
accessUserDeleteBatch,
|
|
|
|
accessUserDeleteBatch,
|
|
|
|
accessUserUpdate,
|
|
|
|
accessUserUpdate,
|
|
|
|
accessUserDetail,
|
|
|
|
accessUserDetail
|
|
|
|
} from '@/api/accessUser'
|
|
|
|
} from "@/api/accessUser";
|
|
|
|
import UserRole from '@/views/accessUser/components/UserRole'
|
|
|
|
import UserRole from "@/views/accessUser/components/UserRole";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'AccessUser',
|
|
|
|
name: "AccessUser",
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
UserRole: UserRole,
|
|
|
|
UserRole: UserRole
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
// 选中一个用户时,点授予角色时,弹出对话框
|
|
|
|
// 选中一个用户时,点授予角色时,弹出对话框
|
|
|
|
dialogVisibleSetRoleForUser: false,
|
|
|
|
dialogVisibleSetRoleForUser: false,
|
|
|
|
loginName: '',
|
|
|
|
loginName: "",
|
|
|
|
|
|
|
|
|
|
|
|
// 页面渲染使用
|
|
|
|
// 页面渲染使用
|
|
|
|
crudOption: {
|
|
|
|
crudOption: {
|
|
|
|
// 使用菜单做为页面标题
|
|
|
|
// 使用菜单做为页面标题
|
|
|
|
title: '用户管理',
|
|
|
|
title: "用户管理",
|
|
|
|
// 详情页中输入框左边文字宽度
|
|
|
|
// 详情页中输入框左边文字宽度
|
|
|
|
labelWidth: '120px',
|
|
|
|
labelWidth: "120px",
|
|
|
|
// 查询表单条件
|
|
|
|
// 查询表单条件
|
|
|
|
queryFormFields: [
|
|
|
|
queryFormFields: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
inputType: 'anji-select', //form表单类型 input|input-number|anji-select(传递url或者dictCode)|anji-tree(左侧树)|date|datetime|datetimerange
|
|
|
|
inputType: "anji-select", //form表单类型 input|input-number|anji-select(传递url或者dictCode)|anji-tree(左侧树)|date|datetime|datetimerange
|
|
|
|
anjiSelectOption: {
|
|
|
|
anjiSelectOption: {
|
|
|
|
dictCode: 'ENABLE_FLAG',
|
|
|
|
dictCode: "ENABLE_FLAG"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
label: '启用状态',
|
|
|
|
label: "启用状态",
|
|
|
|
field: 'enableFlag',
|
|
|
|
field: "enableFlag"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
label: '登录名',
|
|
|
|
label: "登录名",
|
|
|
|
field: 'loginName',
|
|
|
|
field: "loginName"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
label: '真实姓名',
|
|
|
|
label: "真实姓名",
|
|
|
|
field: 'realName',
|
|
|
|
field: "realName"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
label: '手机号',
|
|
|
|
label: "手机号",
|
|
|
|
field: 'phone',
|
|
|
|
field: "phone"
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
// 操作按钮
|
|
|
|
// 操作按钮
|
|
|
|
buttons: {
|
|
|
|
buttons: {
|
|
|
|
query: {
|
|
|
|
query: {
|
|
|
|
api: accessUserList,
|
|
|
|
api: accessUserList,
|
|
|
|
permission: 'userManage:query',
|
|
|
|
permission: "userManage:query"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
queryByPrimarykey: {
|
|
|
|
queryByPrimarykey: {
|
|
|
|
api: accessUserDetail,
|
|
|
|
api: accessUserDetail,
|
|
|
|
permission: 'userManage:query',
|
|
|
|
permission: "userManage:query"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
add: {
|
|
|
|
add: {
|
|
|
|
api: accessUserAdd,
|
|
|
|
api: accessUserAdd,
|
|
|
|
permission: 'userManage:insert',
|
|
|
|
permission: "userManage:insert"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
delete: {
|
|
|
|
delete: {
|
|
|
|
api: accessUserDeleteBatch,
|
|
|
|
api: accessUserDeleteBatch,
|
|
|
|
permission: 'userManage:delete',
|
|
|
|
permission: "userManage:delete"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
edit: {
|
|
|
|
edit: {
|
|
|
|
api: accessUserUpdate,
|
|
|
|
api: accessUserUpdate,
|
|
|
|
permission: 'userManage:update',
|
|
|
|
permission: "userManage:update"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
customButton: {
|
|
|
|
|
|
|
|
operationWidth: "150px"
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表格列
|
|
|
|
// 表格列
|
|
|
|
columns: [
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '',
|
|
|
|
label: "",
|
|
|
|
field: 'id',
|
|
|
|
field: "id",
|
|
|
|
primaryKey: true, // 根据主键查询详情或者根据主键删除时, 主键的
|
|
|
|
primaryKey: true, // 根据主键查询详情或者根据主键删除时, 主键的
|
|
|
|
tableHide: true, // 表格中不显示
|
|
|
|
tableHide: true, // 表格中不显示
|
|
|
|
editHide: true, // 编辑弹框中不显示
|
|
|
|
editHide: true // 编辑弹框中不显示
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '登录名',
|
|
|
|
label: "登录名",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'loginName',
|
|
|
|
field: "loginName",
|
|
|
|
tableHide: true, // 表格中不显示
|
|
|
|
tableHide: true, // 表格中不显示
|
|
|
|
editField: 'loginName',
|
|
|
|
editField: "loginName",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
rules: [
|
|
|
|
rules: [
|
|
|
|
{ required: true, message: '登录名必填', trigger: 'blur' },
|
|
|
|
{ required: true, message: "登录名必填", trigger: "blur" },
|
|
|
|
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
|
|
|
|
{ min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
disabled: false,
|
|
|
|
disabled: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '真实姓名',
|
|
|
|
label: "真实姓名",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'realName',
|
|
|
|
field: "realName",
|
|
|
|
fieldTableRowRenderer: (row) => {
|
|
|
|
fieldTableRowRenderer: row => {
|
|
|
|
return `${row['realName']}[${row['loginName']}]`
|
|
|
|
return `${row["realName"]}[${row["loginName"]}]`;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
editField: 'realName',
|
|
|
|
editField: "realName",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
rules: [
|
|
|
|
rules: [
|
|
|
|
{ required: true, message: '真实姓名必填', trigger: 'blur' },
|
|
|
|
{ required: true, message: "真实姓名必填", trigger: "blur" },
|
|
|
|
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
|
|
|
|
{ min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
disabled: false,
|
|
|
|
disabled: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// {
|
|
|
|
// {
|
|
|
|
// label: '密码',
|
|
|
|
// label: '密码',
|
|
|
@ -141,131 +152,130 @@ export default {
|
|
|
|
// disabled: false,
|
|
|
|
// disabled: false,
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '手机号码',
|
|
|
|
label: "手机号码",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'phone',
|
|
|
|
field: "phone",
|
|
|
|
editField: 'phone',
|
|
|
|
editField: "phone",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
rules: [
|
|
|
|
rules: [
|
|
|
|
{ min: 1, max: 16, message: '不超过16个字符', trigger: 'blur' },
|
|
|
|
{ min: 1, max: 16, message: "不超过16个字符", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
disabled: false,
|
|
|
|
disabled: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '用户邮箱',
|
|
|
|
label: "用户邮箱",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'email',
|
|
|
|
field: "email",
|
|
|
|
editField: 'email',
|
|
|
|
editField: "email",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
rules: [
|
|
|
|
rules: [
|
|
|
|
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
|
|
|
|
{ min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
disabled: false,
|
|
|
|
disabled: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '备注',
|
|
|
|
label: "备注",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'remark',
|
|
|
|
field: "remark",
|
|
|
|
editField: 'remark',
|
|
|
|
editField: "remark",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
rules: [
|
|
|
|
rules: [
|
|
|
|
{ min: 1, max: 512, message: '不超过512个字符', trigger: 'blur' },
|
|
|
|
{ min: 1, max: 512, message: "不超过512个字符", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
disabled: false,
|
|
|
|
disabled: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '启用状态', //0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
|
|
|
|
label: "启用状态", //0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'enableFlag',
|
|
|
|
field: "enableFlag",
|
|
|
|
fieldTableRowRenderer: (row) => {
|
|
|
|
fieldTableRowRenderer: row => {
|
|
|
|
return this.getDictLabelByCode('ENABLE_FLAG', row['enableFlag'])
|
|
|
|
return this.getDictLabelByCode("ENABLE_FLAG", row["enableFlag"]);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
editField: 'enableFlag',
|
|
|
|
editField: "enableFlag",
|
|
|
|
inputType: 'anji-select',
|
|
|
|
inputType: "anji-select",
|
|
|
|
anjiSelectOption: {
|
|
|
|
anjiSelectOption: {
|
|
|
|
dictCode: 'ENABLE_FLAG', //指定数据字典
|
|
|
|
dictCode: "ENABLE_FLAG" //指定数据字典
|
|
|
|
},
|
|
|
|
},
|
|
|
|
colorStyle: {
|
|
|
|
colorStyle: {
|
|
|
|
0: 'table-danger', //key为editField渲染的值(字典的提交值)'红色': 'danger','蓝色': 'primary','绿色': 'success','黄色': 'warning','灰色': 'info','白色':''
|
|
|
|
0: "table-danger", //key为editField渲染的值(字典的提交值)'红色': 'danger','蓝色': 'primary','绿色': 'success','黄色': 'warning','灰色': 'info','白色':''
|
|
|
|
1: 'table-success',
|
|
|
|
1: "table-success"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rules: [
|
|
|
|
rules: [
|
|
|
|
{ required: true, message: '启用状态必填', trigger: 'blur' },
|
|
|
|
{ required: true, message: "启用状态必填", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
disabled: false,
|
|
|
|
disabled: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '最后一次登陆时间',
|
|
|
|
label: "最后一次登陆时间",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'lastLoginTime',
|
|
|
|
field: "lastLoginTime",
|
|
|
|
editField: 'lastLoginTime',
|
|
|
|
editField: "lastLoginTime",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
rules: [],
|
|
|
|
rules: [],
|
|
|
|
disabled: true,
|
|
|
|
disabled: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '最后一次登录IP',
|
|
|
|
label: "最后一次登录IP",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'lastLoginIp',
|
|
|
|
field: "lastLoginIp",
|
|
|
|
editField: 'lastLoginIp',
|
|
|
|
editField: "lastLoginIp",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
rules: [
|
|
|
|
rules: [
|
|
|
|
{ min: 1, max: 16, message: '不超过16个字符', trigger: 'blur' },
|
|
|
|
{ min: 1, max: 16, message: "不超过16个字符", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
disabled: true,
|
|
|
|
disabled: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '创建人',
|
|
|
|
label: "创建人",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'createBy',
|
|
|
|
field: "createBy",
|
|
|
|
columnType: 'expand',
|
|
|
|
columnType: "expand",
|
|
|
|
editField: 'createBy',
|
|
|
|
editField: "createBy",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
editHide: 'hideOnAdd', // 编辑弹框中不显示 true/false/'hideOnAdd hideOnView hideOnEdit'
|
|
|
|
editHide: "hideOnAdd", // 编辑弹框中不显示 true/false/'hideOnAdd hideOnView hideOnEdit'
|
|
|
|
disabled: true,
|
|
|
|
disabled: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '创建时间',
|
|
|
|
label: "创建时间",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'createTime',
|
|
|
|
field: "createTime",
|
|
|
|
columnType: 'expand',
|
|
|
|
columnType: "expand",
|
|
|
|
editField: 'createTime',
|
|
|
|
editField: "createTime",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
editHide: 'hideOnAdd', // 编辑弹框中不显示 true/false/'hideOnAdd hideOnView hideOnEdit'
|
|
|
|
editHide: "hideOnAdd", // 编辑弹框中不显示 true/false/'hideOnAdd hideOnView hideOnEdit'
|
|
|
|
disabled: true,
|
|
|
|
disabled: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '修改人',
|
|
|
|
label: "修改人",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'updateBy',
|
|
|
|
field: "updateBy",
|
|
|
|
columnType: 'expand',
|
|
|
|
columnType: "expand",
|
|
|
|
editField: 'updateBy',
|
|
|
|
editField: "updateBy",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
editHide: 'hideOnAdd', // 编辑弹框中不显示 true/false/'hideOnAdd hideOnView hideOnEdit'
|
|
|
|
editHide: "hideOnAdd", // 编辑弹框中不显示 true/false/'hideOnAdd hideOnView hideOnEdit'
|
|
|
|
disabled: true,
|
|
|
|
disabled: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '修改时间',
|
|
|
|
label: "修改时间",
|
|
|
|
placeholder: '',
|
|
|
|
placeholder: "",
|
|
|
|
field: 'updateTime',
|
|
|
|
field: "updateTime",
|
|
|
|
columnType: 'expand',
|
|
|
|
columnType: "expand",
|
|
|
|
editField: 'updateTime',
|
|
|
|
editField: "updateTime",
|
|
|
|
inputType: 'input',
|
|
|
|
inputType: "input",
|
|
|
|
editHide: 'hideOnAdd', // 编辑弹框中不显示 true/false/'hideOnAdd hideOnView hideOnEdit'
|
|
|
|
editHide: "hideOnAdd", // 编辑弹框中不显示 true/false/'hideOnAdd hideOnView hideOnEdit'
|
|
|
|
disabled: true,
|
|
|
|
disabled: true
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
created() {},
|
|
|
|
created() {},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
handleOpenDialogSetRoleForUser(props) {
|
|
|
|
handleOpenDialogSetRoleForUser(props) {
|
|
|
|
this.loginName = props.msg.loginName
|
|
|
|
this.loginName = props.msg.loginName;
|
|
|
|
this.dialogVisibleSetRoleForUser = true
|
|
|
|
this.dialogVisibleSetRoleForUser = true;
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|