|
|
@ -9,83 +9,39 @@ |
|
|
|
<el-col :span="20" :xs="24"> |
|
|
|
<!-- 搜索 --> |
|
|
|
<ContentWrap> |
|
|
|
<el-form |
|
|
|
class="-mb-15px" |
|
|
|
:model="queryParams" |
|
|
|
ref="queryFormRef" |
|
|
|
:inline="true" |
|
|
|
label-width="68px" |
|
|
|
> |
|
|
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px"> |
|
|
|
<el-form-item label="用户名称" prop="username"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.username" |
|
|
|
placeholder="请输入用户名称" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
class="!w-240px" |
|
|
|
/> |
|
|
|
<el-input v-model="queryParams.username" placeholder="请输入用户名称" clearable @keyup.enter="handleQuery" |
|
|
|
class="!w-240px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="手机号码" prop="mobile"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.mobile" |
|
|
|
placeholder="请输入手机号码" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
class="!w-240px" |
|
|
|
/> |
|
|
|
<el-input v-model="queryParams.mobile" placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" |
|
|
|
class="!w-240px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
<el-select |
|
|
|
v-model="queryParams.status" |
|
|
|
placeholder="用户状态" |
|
|
|
clearable |
|
|
|
class="!w-240px" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value" |
|
|
|
/> |
|
|
|
<el-select v-model="queryParams.status" placeholder="用户状态" clearable class="!w-240px"> |
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" :key="dict.value" :label="dict.label" |
|
|
|
:value="dict.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="创建时间" prop="createTime"> |
|
|
|
<el-date-picker |
|
|
|
v-model="queryParams.createTime" |
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
type="datetimerange" |
|
|
|
start-placeholder="开始日期" |
|
|
|
end-placeholder="结束日期" |
|
|
|
class="!w-240px" |
|
|
|
/> |
|
|
|
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" |
|
|
|
start-placeholder="开始日期" end-placeholder="结束日期" class="!w-240px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button |
|
|
|
type="info" |
|
|
|
plain @click="handleQuery"><Icon icon="ep:search" />搜索</el-button> |
|
|
|
<el-button |
|
|
|
type="info" |
|
|
|
plain @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
@click="openForm('create')" |
|
|
|
v-hasPermi="['system:user:create']" |
|
|
|
> |
|
|
|
<el-button type="info" plain @click="handleQuery"> |
|
|
|
<Icon icon="ep:search" />搜索 |
|
|
|
</el-button> |
|
|
|
<el-button type="info" plain @click="resetQuery"> |
|
|
|
<Icon icon="ep:refresh" />重置 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" @click="openForm('create')" v-hasPermi="['system:user:create']"> |
|
|
|
<Icon icon="ep:plus" /> 新增 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
@click="handleImport" |
|
|
|
v-hasPermi="['system:user:import']" |
|
|
|
> |
|
|
|
<el-button type="warning" @click="handleImport" v-hasPermi="['system:user:import']"> |
|
|
|
<Icon icon="ep:upload" /> 导入 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
@click="handleExport" |
|
|
|
:loading="exportLoading" |
|
|
|
v-hasPermi="['system:user:export']" |
|
|
|
> |
|
|
|
<el-button type="success" @click="handleExport" :loading="exportLoading" v-hasPermi="['system:user:export']"> |
|
|
|
<Icon icon="ep:download" />导出 |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
@ -94,96 +50,41 @@ |
|
|
|
<ContentWrap> |
|
|
|
<el-table v-loading="loading" :data="list"> |
|
|
|
<el-table-column label="用户编号" align="center" key="id" prop="id" /> |
|
|
|
<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" |
|
|
|
key="deptName" |
|
|
|
prop="dept.name" |
|
|
|
: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" key="deptName" prop="dept.name" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="手机号码" align="center" prop="mobile" width="120" /> |
|
|
|
<el-table-column label="状态" key="status"> |
|
|
|
<el-table-column label="状态" align="center" key="status"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-switch |
|
|
|
v-model="scope.row.status" |
|
|
|
:active-value="0" |
|
|
|
:inactive-value="1" |
|
|
|
@change="handleStatusChange(scope.row)" |
|
|
|
/> |
|
|
|
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" |
|
|
|
@change="handleStatusChange(scope.row)" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="创建时间" |
|
|
|
align="center" |
|
|
|
prop="createTime" |
|
|
|
:formatter="dateFormatter" |
|
|
|
width="180" |
|
|
|
/> |
|
|
|
<el-table-column label="操作" align="center" width="160"> |
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180" /> |
|
|
|
<el-table-column label="操作" align="center" width="300" fixed="right"> |
|
|
|
<template #default="scope"> |
|
|
|
<div class="flex items-center justify-center"> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
link |
|
|
|
@click="openForm('update', scope.row.id)" |
|
|
|
v-hasPermi="['system:user:update']" |
|
|
|
> |
|
|
|
<el-button type="primary" link @click="openForm('update', scope.row.id)" |
|
|
|
v-hasPermi="['system:user:update']"> |
|
|
|
<Icon icon="ep:edit" />修改 |
|
|
|
</el-button> |
|
|
|
<el-dropdown |
|
|
|
@command="(command) => handleCommand(command, scope.row)" |
|
|
|
v-hasPermi="[ |
|
|
|
'system:user:delete', |
|
|
|
'system:user:update-password', |
|
|
|
'system:permission:assign-user-role' |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-button type="primary" link><Icon icon="ep:d-arrow-right" /> 更多</el-button> |
|
|
|
<template #dropdown> |
|
|
|
<el-dropdown-menu> |
|
|
|
<el-dropdown-item |
|
|
|
command="handleDelete" |
|
|
|
v-if="checkPermi(['system:user:delete'])" |
|
|
|
> |
|
|
|
<Icon icon="ep:delete" />删除 |
|
|
|
</el-dropdown-item> |
|
|
|
<el-dropdown-item |
|
|
|
command="handleResetPwd" |
|
|
|
v-if="checkPermi(['system:user:update-password'])" |
|
|
|
> |
|
|
|
<Icon icon="ep:key" />重置密码 |
|
|
|
</el-dropdown-item> |
|
|
|
<el-dropdown-item |
|
|
|
command="handleRole" |
|
|
|
v-if="checkPermi(['system:permission:assign-user-role'])" |
|
|
|
> |
|
|
|
<Icon icon="ep:circle-check" />分配角色 |
|
|
|
</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</template> |
|
|
|
</el-dropdown> |
|
|
|
<el-button type="primary" link @click="handleResetPwd(scope.row)" |
|
|
|
v-hasPermi="['system:user:update-password']"> |
|
|
|
<Icon icon="ep:key" />重置密码 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" link @click="handleRole(scope.row)" |
|
|
|
v-hasPermi="['system:permission:assign-user-role']"> |
|
|
|
<Icon icon="ep:circle-check" />分配角色 |
|
|
|
</el-button> |
|
|
|
<el-button type="danger" link @click="handleDelete(scope.row.id)" v-hasPermi="['system:user:delete']"> |
|
|
|
<Icon icon="ep:delete" />删除 |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<Pagination |
|
|
|
:total="total" |
|
|
|
v-model:page="queryParams.pageNo" |
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
/> |
|
|
|
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" |
|
|
|
@pagination="getList" /> |
|
|
|
</ContentWrap> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -328,7 +229,7 @@ const handleDelete = async (id: number) => { |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 重置密码 */ |
|
|
@ -343,7 +244,7 @@ const handleResetPwd = async (row: UserApi.UserVO) => { |
|
|
|
// 发起重置 |
|
|
|
await UserApi.resetUserPwd(row.id, password) |
|
|
|
message.success('修改成功,新密码是:' + password) |
|
|
|
} catch {} |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 分配角色 */ |
|
|
|