|
|
@ -1,222 +1,200 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 左侧部门树 --> |
|
|
|
<section class="flex flex-col gap-20px"> |
|
|
|
<el-col :span="4" :xs="24"> |
|
|
|
<el-form |
|
|
|
<ContentWrap class="h-1/1"> |
|
|
|
class="-mb-15px" |
|
|
|
<DeptTree @node-click="handleDeptNodeClick" /> |
|
|
|
:model="queryParams" |
|
|
|
</ContentWrap> |
|
|
|
ref="queryFormRef" |
|
|
|
</el-col> |
|
|
|
:inline="true" |
|
|
|
<el-col :span="20" :xs="24"> |
|
|
|
label-width="68px" |
|
|
|
<!-- 搜索 --> |
|
|
|
> |
|
|
|
<ContentWrap> |
|
|
|
<el-form-item label="用名称" prop="username"> |
|
|
|
<section class="flex flex-col gap-20px"> |
|
|
|
<el-input |
|
|
|
<el-form |
|
|
|
v-model="queryParams.realName" |
|
|
|
class="-mb-15px" |
|
|
|
placeholder="请输入用户名称" |
|
|
|
:model="queryParams" |
|
|
|
clearable |
|
|
|
ref="queryFormRef" |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
:inline="true" |
|
|
|
class="!w-240px" |
|
|
|
label-width="68px" |
|
|
|
/> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="" prop="mobile"> |
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
|
|
v-model="queryParams.mobile" |
|
|
|
|
|
|
|
placeholder="请输入手机号码" |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="" prop="status" v-if="!isInset"> |
|
|
|
|
|
|
|
<el-select |
|
|
|
|
|
|
|
v-model="queryParams.status" |
|
|
|
|
|
|
|
placeholder="用户状态" |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
class="!w-240px" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-form-item label="用名称" prop="username"> |
|
|
|
<el-option |
|
|
|
<el-input |
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" |
|
|
|
v-model="queryParams.realName" |
|
|
|
:key="dict.value" |
|
|
|
placeholder="请输入用户名称" |
|
|
|
:label="dict.label" |
|
|
|
clearable |
|
|
|
:value="dict.value" |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
class="!w-240px" |
|
|
|
</el-select> |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="" prop="createTime" v-if="!isInset"> |
|
|
|
<el-form-item label="" prop="mobile"> |
|
|
|
<el-date-picker |
|
|
|
<el-input |
|
|
|
v-model="queryParams.createTime" |
|
|
|
v-model="queryParams.mobile" |
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
placeholder="请输入手机号码" |
|
|
|
type="datetimerange" |
|
|
|
clearable |
|
|
|
start-placeholder="开始日期" |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
end-placeholder="结束日期" |
|
|
|
class="!w-240px" |
|
|
|
class="!w-240px" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="" prop="status" v-if="!isInset"> |
|
|
|
<el-form-item> |
|
|
|
<el-select |
|
|
|
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button> |
|
|
|
v-model="queryParams.status" |
|
|
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button> |
|
|
|
placeholder="用户状态" |
|
|
|
<el-button |
|
|
|
clearable |
|
|
|
type="primary" |
|
|
|
class="!w-240px" |
|
|
|
plain |
|
|
|
> |
|
|
|
@click="openForm('create')" |
|
|
|
<el-option |
|
|
|
v-hasPermi="['system:user:create']" |
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" |
|
|
|
v-if="!isInset" |
|
|
|
:key="dict.value" |
|
|
|
> |
|
|
|
:label="dict.label" |
|
|
|
<Icon icon="ep:plus" /> 新增 |
|
|
|
:value="dict.value" |
|
|
|
</el-button> |
|
|
|
/> |
|
|
|
<el-button |
|
|
|
</el-select> |
|
|
|
type="warning" |
|
|
|
</el-form-item> |
|
|
|
plain |
|
|
|
<el-form-item label="" prop="createTime" v-if="!isInset"> |
|
|
|
@click="handleImport" |
|
|
|
<el-date-picker |
|
|
|
v-hasPermi="['system:user:import']" |
|
|
|
v-model="queryParams.createTime" |
|
|
|
v-if="!isInset" |
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
> |
|
|
|
type="datetimerange" |
|
|
|
<Icon icon="ep:upload" /> 导入 |
|
|
|
start-placeholder="开始日期" |
|
|
|
</el-button> |
|
|
|
end-placeholder="结束日期" |
|
|
|
<el-button |
|
|
|
class="!w-240px" |
|
|
|
type="success" |
|
|
|
/> |
|
|
|
plain |
|
|
|
</el-form-item> |
|
|
|
@click="handleExport" |
|
|
|
<el-form-item> |
|
|
|
:loading="exportLoading" |
|
|
|
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button> |
|
|
|
v-hasPermi="['system:user:export']" |
|
|
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button> |
|
|
|
v-if="!isInset" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Icon icon="ep:download" />导出 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="list"> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
|
|
|
|
label="真实姓名" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
prop="realName" |
|
|
|
|
|
|
|
:show-overflow-tooltip="true" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column label="用户性别" align="center" prop="sex" width="120" > |
|
|
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
|
|
{{getDictLabel(DICT_TYPE.SYSTEM_USER_SEX, scope.row.sex)}} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="手机号码" align="center" prop="mobile" width="120" /> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
|
|
|
|
label="所属部门" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
key="deptName" |
|
|
|
|
|
|
|
prop="deptName" |
|
|
|
|
|
|
|
:show-overflow-tooltip="true" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column label="状态" key="status" v-if="!isInset"> |
|
|
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
|
|
<el-switch |
|
|
|
|
|
|
|
v-model="scope.row.status" |
|
|
|
|
|
|
|
:active-value="0" |
|
|
|
|
|
|
|
:inactive-value="1" |
|
|
|
|
|
|
|
@change="handleStatusChange(scope.row)" |
|
|
|
|
|
|
|
:disabled="!checkPermi(['system:user:update'])" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
|
|
|
|
label="创建时间" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
prop="createTime" |
|
|
|
|
|
|
|
:formatter="dateFormatter" |
|
|
|
|
|
|
|
width="180" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" width="160" v-if="!isInset"> |
|
|
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
|
|
<div class="flex items-center justify-center"> |
|
|
|
<el-button |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
plain |
|
|
|
link |
|
|
|
@click="openForm('create')" |
|
|
|
@click="openForm('update', scope.row.id)" |
|
|
|
v-hasPermi="['system:user:create']" |
|
|
|
v-hasPermi="['system:user:update']" |
|
|
|
v-if="!isInset" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<Icon icon="ep:plus" /> 新增 |
|
|
|
<Icon icon="ep:edit" />修改 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
<el-dropdown |
|
|
|
type="warning" |
|
|
|
@command="(command) => handleCommand(command, scope.row)" |
|
|
|
plain |
|
|
|
v-hasPermi="[ |
|
|
|
@click="handleImport" |
|
|
|
'system:user:delete', |
|
|
|
v-hasPermi="['system:user:import']" |
|
|
|
'system:user:update-password', |
|
|
|
v-if="!isInset" |
|
|
|
'system:permission:assign-user-role' |
|
|
|
|
|
|
|
]" |
|
|
|
> |
|
|
|
> |
|
|
|
<Icon icon="ep:upload" /> 导入 |
|
|
|
<el-button type="primary" link><Icon icon="ep:d-arrow-right" /> 更多</el-button> |
|
|
|
</el-button> |
|
|
|
<template #dropdown> |
|
|
|
<el-button |
|
|
|
<el-dropdown-menu> |
|
|
|
type="success" |
|
|
|
<el-dropdown-item |
|
|
|
plain |
|
|
|
command="handleDelete" |
|
|
|
@click="handleExport" |
|
|
|
v-if="checkPermi(['system:user:delete'])" |
|
|
|
:loading="exportLoading" |
|
|
|
> |
|
|
|
v-hasPermi="['system:user:export']" |
|
|
|
<Icon icon="ep:delete" />删除 |
|
|
|
v-if="!isInset" |
|
|
|
</el-dropdown-item> |
|
|
|
> |
|
|
|
<el-dropdown-item |
|
|
|
<Icon icon="ep:download" />导出 |
|
|
|
command="handleDelete2" |
|
|
|
</el-button> |
|
|
|
v-if="checkPermi(['system:user:deleteAllData'])" |
|
|
|
</el-form-item> |
|
|
|
> |
|
|
|
</el-form> |
|
|
|
<Icon icon="ep:delete" />测试删除全部数据 |
|
|
|
|
|
|
|
</el-dropdown-item> |
|
|
|
<el-table v-loading="loading" :data="list"> |
|
|
|
<el-dropdown-item |
|
|
|
<el-table-column |
|
|
|
command="handleResetPwd" |
|
|
|
label="头像" |
|
|
|
v-if="checkPermi(['system:user:update-password'])" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
prop="realName" |
|
|
|
<Icon icon="ep:key" />重置密码 |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
</el-dropdown-item> |
|
|
|
> |
|
|
|
<el-dropdown-item |
|
|
|
<template #default="scope"> |
|
|
|
command="handleRole" |
|
|
|
<el-image |
|
|
|
v-if="checkPermi(['system:permission:assign-user-role'])" |
|
|
|
style="width: 60px; height: 60px;border-radius: 50%;" |
|
|
|
> |
|
|
|
:src="scope.row.avatar" |
|
|
|
<Icon icon="ep:circle-check" />分配角色 |
|
|
|
:preview-src-list="[scope.row.avatar]" |
|
|
|
</el-dropdown-item> |
|
|
|
:preview-teleported="true" |
|
|
|
</el-dropdown-menu> |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-dropdown> |
|
|
|
</el-table-column> |
|
|
|
</div> |
|
|
|
<el-table-column label="用户编号" align="center" key="id" prop="id" /> |
|
|
|
</template> |
|
|
|
<el-table-column |
|
|
|
</el-table-column> |
|
|
|
label="用户名称" |
|
|
|
<el-table-column label="操作" align="center" width="100" v-if="isInset"> |
|
|
|
align="center" |
|
|
|
<template #default="{ row }"> |
|
|
|
prop="realName" |
|
|
|
<el-button type="primary" link @click="selectUser(row.id)"> |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
<Icon icon="ep:select" />选择 |
|
|
|
/> |
|
|
|
</el-button> |
|
|
|
<el-table-column |
|
|
|
</template> |
|
|
|
label="部门" |
|
|
|
</el-table-column> |
|
|
|
align="center" |
|
|
|
</el-table> |
|
|
|
key="deptName" |
|
|
|
<!-- 分页 --> |
|
|
|
prop="deptName" |
|
|
|
<el-pagination |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
:total="total" |
|
|
|
/> |
|
|
|
:show-page-size="false" |
|
|
|
<el-table-column label="手机号码" align="center" prop="mobile" width="120" /> |
|
|
|
layout="total, prev, pager, next" |
|
|
|
<el-table-column label="状态" key="status" v-if="!isInset"> |
|
|
|
v-model:current-page="queryParams.pageNo" |
|
|
|
<template #default="scope"> |
|
|
|
v-model:page-size="queryParams.pageSize" |
|
|
|
<el-switch |
|
|
|
@change="getList" |
|
|
|
v-model="scope.row.status" |
|
|
|
class="ml-auto" |
|
|
|
:active-value="0" |
|
|
|
/> |
|
|
|
:inactive-value="1" |
|
|
|
</section> |
|
|
|
@change="handleStatusChange(scope.row)" |
|
|
|
</ContentWrap> |
|
|
|
:disabled="!checkPermi(['system:user:update'])" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
|
|
|
|
label="创建时间" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
prop="createTime" |
|
|
|
|
|
|
|
:formatter="dateFormatter" |
|
|
|
|
|
|
|
width="180" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" width="160" v-if="!isInset"> |
|
|
|
|
|
|
|
<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']" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<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="handleDelete2" |
|
|
|
|
|
|
|
v-if="checkPermi(['system:user:deleteAllData'])" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<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> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" width="100" v-if="isInset"> |
|
|
|
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
|
|
|
<el-button type="primary" link @click="selectUser(row.id)"> |
|
|
|
|
|
|
|
<Icon icon="ep:select" />选择 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<!-- 分页 --> |
|
|
|
|
|
|
|
<el-pagination |
|
|
|
|
|
|
|
:total="total" |
|
|
|
|
|
|
|
:show-page-size="false" |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
v-model:current-page="queryParams.pageNo" |
|
|
|
|
|
|
|
v-model:page-size="queryParams.pageSize" |
|
|
|
|
|
|
|
@change="getList" |
|
|
|
|
|
|
|
class="ml-auto" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</section> |
|
|
|
|
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改用户对话框 --> |
|
|
|
<!-- 添加或修改用户对话框 --> |
|
|
|
<UserForm ref="formRef" @success="getList" /> |
|
|
|
<UserForm ref="formRef" @success="getList" /> |
|
|
@ -226,7 +204,7 @@ |
|
|
|
<UserAssignRoleForm ref="assignRoleFormRef" @success="getList" /> |
|
|
|
<UserAssignRoleForm ref="assignRoleFormRef" @success="getList" /> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
|
|
|
import { DICT_TYPE, getIntDictOptions, getDictLabel } from '@/utils/dict' |
|
|
|
import { checkPermi } from '@/utils/permission' |
|
|
|
import { checkPermi } from '@/utils/permission' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
import download from '@/utils/download' |
|
|
|
import download from '@/utils/download' |
|
|
@ -235,7 +213,6 @@ import * as UserApi from '@/api/system/user' |
|
|
|
import UserForm from './UserForm.vue' |
|
|
|
import UserForm from './UserForm.vue' |
|
|
|
import UserImportForm from './UserImportForm.vue' |
|
|
|
import UserImportForm from './UserImportForm.vue' |
|
|
|
import UserAssignRoleForm from './UserAssignRoleForm.vue' |
|
|
|
import UserAssignRoleForm from './UserAssignRoleForm.vue' |
|
|
|
import DeptTree from './DeptTree.vue' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'SystemUser' }) |
|
|
|
defineOptions({ name: 'SystemUser' }) |
|
|
|
|
|
|
|
|
|
|
|