|
|
|
@ -1,105 +1,100 @@ |
|
|
|
|
<template> |
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
<!-- 左侧部门树 --> |
|
|
|
|
<el-col :span="4" :xs="24"> |
|
|
|
|
<!-- <el-row :gutter="20"> --> |
|
|
|
|
<!-- 左侧部门树 --> |
|
|
|
|
<!-- <el-col :span="4" :xs="24"> |
|
|
|
|
<DeptTree @node-click="handleDeptNodeClick" /> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="20" :xs="24"> |
|
|
|
|
<!-- 搜索 --> |
|
|
|
|
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px"> |
|
|
|
|
<el-form-item label="姓名" prop="nickname"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="queryParams.nickname" |
|
|
|
|
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-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button @click="handleQuery" v-hasPermi="['basic:employee:search']">搜索</el-button> |
|
|
|
|
<el-button @click="resetQuery" v-hasPermi="['basic:employee:reset']">重置</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
plain |
|
|
|
|
@click="openForm('create')" |
|
|
|
|
v-hasPermi="['basic:employee:add']" |
|
|
|
|
> |
|
|
|
|
新增 |
|
|
|
|
</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<el-table v-loading="loading" :data="list"> |
|
|
|
|
<el-table-column label="用户编号" key="id" prop="id" /> |
|
|
|
|
<el-table-column label="登录账号" prop="username" /> |
|
|
|
|
<el-table-column label="用户姓名" prop="nickname" /> |
|
|
|
|
<el-table-column label="部门" key="deptName" prop="deptName" /> |
|
|
|
|
<el-table-column label="手机号码" prop="mobile" width="120" /> |
|
|
|
|
<el-table-column label="状态" key="status"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-switch |
|
|
|
|
v-model="scope.row.status" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
active-text="在职" |
|
|
|
|
inactive-text="离职" |
|
|
|
|
v-hasPermi="['basic:employee:update']" |
|
|
|
|
@change="handleStatusChange(scope.row)" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
label="创建时间" |
|
|
|
|
prop="createTime" |
|
|
|
|
width="180" |
|
|
|
|
:formatter="dateFormatter" |
|
|
|
|
/> |
|
|
|
|
<el-table-column label="操作" width="260"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
link |
|
|
|
|
@click="openForm('update', scope.row.id)" |
|
|
|
|
v-hasPermi="['basic:employee:update']" |
|
|
|
|
> |
|
|
|
|
修改 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
link |
|
|
|
|
@click="handleDelete(scope.row.id)" |
|
|
|
|
v-hasPermi="['basic:employee:delete']" |
|
|
|
|
> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
link |
|
|
|
|
@click="handleResetPwd(scope.row)" |
|
|
|
|
v-hasPermi="['basic:employee:password']" |
|
|
|
|
> |
|
|
|
|
重置密码 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<Pagination |
|
|
|
|
:total="total" |
|
|
|
|
v-model:page="queryParams.pageNo" |
|
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
|
@pagination="getList" |
|
|
|
|
<el-col :span="20" :xs="24"> --> |
|
|
|
|
<!-- 搜索 --> |
|
|
|
|
<el-form :model="queryParams" ref="queryFormRef" inline label-width="0"> |
|
|
|
|
<el-form-item prop="nickname"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="queryParams.nickname" |
|
|
|
|
placeholder="请输入姓名" |
|
|
|
|
clearable |
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
class="!w-240px" |
|
|
|
|
/> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="mobile"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="queryParams.mobile" |
|
|
|
|
placeholder="请输入手机号码" |
|
|
|
|
clearable |
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
class="!w-240px" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button @click="handleQuery" v-hasPermi="['basic:employee:search']">搜索</el-button> |
|
|
|
|
<el-button @click="resetQuery" v-hasPermi="['basic:employee:reset']">重置</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
plain |
|
|
|
|
@click="openForm('create')" |
|
|
|
|
v-hasPermi="['basic:employee:add']" |
|
|
|
|
> |
|
|
|
|
新增 |
|
|
|
|
</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<el-table v-loading="loading" :data="list"> |
|
|
|
|
<el-table-column label="用户编号" key="id" prop="id" /> |
|
|
|
|
<el-table-column label="登录账号" prop="username" /> |
|
|
|
|
<el-table-column label="用户姓名" prop="nickname" /> |
|
|
|
|
<!-- <el-table-column label="部门" key="deptName" prop="deptName" /> --> |
|
|
|
|
<el-table-column label="手机号码" prop="mobile" width="120" /> |
|
|
|
|
<el-table-column label="状态" key="status"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-switch |
|
|
|
|
v-model="scope.row.status" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
active-text="在职" |
|
|
|
|
inactive-text="离职" |
|
|
|
|
v-hasPermi="['basic:employee:update']" |
|
|
|
|
@change="handleStatusChange(scope.row)" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" /> |
|
|
|
|
<el-table-column label="操作" width="260"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
link |
|
|
|
|
@click="openForm('update', scope.row.id)" |
|
|
|
|
v-hasPermi="['basic:employee:update']" |
|
|
|
|
> |
|
|
|
|
修改 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
link |
|
|
|
|
@click="handleDelete(scope.row.id)" |
|
|
|
|
v-hasPermi="['basic:employee:delete']" |
|
|
|
|
> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
link |
|
|
|
|
@click="handleResetPwd(scope.row)" |
|
|
|
|
v-hasPermi="['basic:employee:password']" |
|
|
|
|
> |
|
|
|
|
重置密码 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<Pagination |
|
|
|
|
:total="total" |
|
|
|
|
v-model:page="queryParams.pageNo" |
|
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
|
@pagination="getList" |
|
|
|
|
/> |
|
|
|
|
<!-- </el-col> --> |
|
|
|
|
<!-- </el-row> --> |
|
|
|
|
|
|
|
|
|
<!-- 添加或修改用户对话框 --> |
|
|
|
|
<UserForm ref="formRef" @success="getList" /> |
|
|
|
@ -109,7 +104,7 @@ import { CommonStatusEnum } from '@/utils/constants' |
|
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
|
import * as UserApi from '@/api/system/user' |
|
|
|
|
import UserForm from './UserForm.vue' |
|
|
|
|
import DeptTree from './DeptTree.vue' |
|
|
|
|
// import DeptTree from './DeptTree.vue' |
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
|
@ -150,11 +145,11 @@ const resetQuery = () => { |
|
|
|
|
handleQuery() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理部门被点击 */ |
|
|
|
|
const handleDeptNodeClick = async (row) => { |
|
|
|
|
queryParams.deptId = row.id |
|
|
|
|
await getList() |
|
|
|
|
} |
|
|
|
|
// /** 处理部门被点击 */ |
|
|
|
|
// const handleDeptNodeClick = async (row) => { |
|
|
|
|
// queryParams.deptId = row.id |
|
|
|
|
// await getList() |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
|
const formRef = ref() |
|
|
|
|