|
|
@ -5,50 +5,53 @@ |
|
|
|
<el-col :span="24" :xs="24"> |
|
|
|
<el-col :span="24" :xs="24"> |
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
|
|
|
label-width="68px"> |
|
|
|
label-width="68px"> |
|
|
|
<el-form-item label="用户名称" prop="userName"> |
|
|
|
<el-form-item label="用户昵称" prop="nickName"> |
|
|
|
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" |
|
|
|
<el-input v-model="queryParams.nickName" placeholder="请输入用户昵称" clearable style="width: 240px" |
|
|
|
|
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="ID" prop="userId"> |
|
|
|
|
|
|
|
<el-input v-model="queryParams.userId" placeholder="请输入用户ID" clearable style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="手机号码" prop="phonenumber"> |
|
|
|
<el-form-item label="手机号码" prop="phonenumber"> |
|
|
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px" |
|
|
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
<el-form-item label="性别" prop="sex"> |
|
|
|
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px"> |
|
|
|
<el-select v-model="queryParams.sex" placeholder="请选择性别" clearable> |
|
|
|
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" |
|
|
|
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" |
|
|
|
:value="dict.value" /> |
|
|
|
:value="dict.value"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="创建时间"> |
|
|
|
<el-form-item label="注册时间"> |
|
|
|
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" |
|
|
|
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" |
|
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> |
|
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
|
|
|
|
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px"> |
|
|
|
|
|
|
|
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" |
|
|
|
|
|
|
|
:value="dict.value" /> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
|
|
|
<el-button type="primary" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">新增用户</el-button> |
|
|
|
v-hasPermi="['system:user:add']">新增</el-button> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" |
|
|
|
<el-button size="mini" v-hasPermi="['system:user:edit']" @click="updateStatusByUserId('0')">批量开启</el-button> |
|
|
|
v-hasPermi="['system:user:edit']">修改</el-button> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" |
|
|
|
<el-button size="mini" v-hasPermi="['system:user:edit']" @click="updateStatusByUserId('1')">批量禁用</el-button> |
|
|
|
v-hasPermi="['system:user:remove']">删除</el-button> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" |
|
|
|
<el-button size="mini" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button> |
|
|
|
v-hasPermi="['system:user:import']">导入</el-button> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="1.5"> |
|
|
|
|
|
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" |
|
|
|
|
|
|
|
v-hasPermi="['system:user:export']">导出</el-button> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
@ -236,7 +239,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect, phoneSelect } from "@/api/system/user"; |
|
|
|
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, phoneSelect, updateStatus } from "@/api/system/user"; |
|
|
|
import { getToken } from "@/utils/auth"; |
|
|
|
import { getToken } from "@/utils/auth"; |
|
|
|
import Treeselect from "@riophae/vue-treeselect"; |
|
|
|
import Treeselect from "@riophae/vue-treeselect"; |
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
|
|
@ -265,12 +268,8 @@ export default { |
|
|
|
userList: null, |
|
|
|
userList: null, |
|
|
|
// 弹出层标题 |
|
|
|
// 弹出层标题 |
|
|
|
title: "", |
|
|
|
title: "", |
|
|
|
// 部门树选项 |
|
|
|
|
|
|
|
deptOptions: undefined, |
|
|
|
|
|
|
|
// 是否显示弹出层 |
|
|
|
// 是否显示弹出层 |
|
|
|
open: false, |
|
|
|
open: false, |
|
|
|
// 部门名称 |
|
|
|
|
|
|
|
deptName: undefined, |
|
|
|
|
|
|
|
// 默认密码 |
|
|
|
// 默认密码 |
|
|
|
initPassword: undefined, |
|
|
|
initPassword: undefined, |
|
|
|
// 日期范围 |
|
|
|
// 日期范围 |
|
|
@ -304,10 +303,11 @@ export default { |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
userName: undefined, |
|
|
|
userId: undefined, |
|
|
|
|
|
|
|
nickName: undefined, |
|
|
|
phonenumber: undefined, |
|
|
|
phonenumber: undefined, |
|
|
|
status: undefined, |
|
|
|
status: undefined, |
|
|
|
deptId: undefined |
|
|
|
sex: undefined |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 列信息 |
|
|
|
// 列信息 |
|
|
|
columns: [ |
|
|
|
columns: [ |
|
|
@ -345,24 +345,24 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
|
|
|
|
// 根据名称筛选部门树 |
|
|
|
|
|
|
|
deptName(val) { |
|
|
|
|
|
|
|
this.$refs.tree.filter(val); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
created() { |
|
|
|
this.getList(); |
|
|
|
this.getList(); |
|
|
|
this.getDeptTree(); |
|
|
|
|
|
|
|
this.getConfigKey("sys.user.initPassword").then(response => { |
|
|
|
this.getConfigKey("sys.user.initPassword").then(response => { |
|
|
|
this.initPassword = response.msg; |
|
|
|
this.initPassword = response.msg; |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
handleSelectPhone(item) { |
|
|
|
//批量更新用户状态 |
|
|
|
debugger |
|
|
|
updateStatusByUserId(status) { |
|
|
|
form.referrerId = item.userId |
|
|
|
updateStatus({ |
|
|
|
|
|
|
|
userIds: this.ids.join(","), |
|
|
|
|
|
|
|
status |
|
|
|
|
|
|
|
}).then(response => { |
|
|
|
|
|
|
|
this.$modal.msgSuccess(`批量${status === "0" ? "开启" : "禁用"}成功`); |
|
|
|
|
|
|
|
this.getList() |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 模糊查询手机号 |
|
|
|
queryByPhone(queryString, cb) { |
|
|
|
queryByPhone(queryString, cb) { |
|
|
|
phoneSelect(queryString).then(response => { |
|
|
|
phoneSelect(queryString).then(response => { |
|
|
|
const data = response.data.map(item => { |
|
|
|
const data = response.data.map(item => { |
|
|
@ -385,12 +385,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 查询部门下拉树结构 */ |
|
|
|
|
|
|
|
getDeptTree() { |
|
|
|
|
|
|
|
deptTreeSelect().then(response => { |
|
|
|
|
|
|
|
this.deptOptions = response.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 筛选节点 |
|
|
|
// 筛选节点 |
|
|
|
filterNode(value, data) { |
|
|
|
filterNode(value, data) { |
|
|
|
if (!value) return true; |
|
|
|
if (!value) return true; |
|
|
@ -398,7 +392,6 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 节点单击事件 |
|
|
|
// 节点单击事件 |
|
|
|
handleNodeClick(data) { |
|
|
|
handleNodeClick(data) { |
|
|
|
this.queryParams.deptId = data.id; |
|
|
|
|
|
|
|
this.handleQuery(); |
|
|
|
this.handleQuery(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 用户状态修改 |
|
|
|
// 用户状态修改 |
|
|
@ -421,7 +414,6 @@ export default { |
|
|
|
reset() { |
|
|
|
reset() { |
|
|
|
this.form = { |
|
|
|
this.form = { |
|
|
|
userId: undefined, |
|
|
|
userId: undefined, |
|
|
|
deptId: undefined, |
|
|
|
|
|
|
|
userName: undefined, |
|
|
|
userName: undefined, |
|
|
|
nickName: undefined, |
|
|
|
nickName: undefined, |
|
|
|
password: undefined, |
|
|
|
password: undefined, |
|
|
@ -447,8 +439,6 @@ export default { |
|
|
|
resetQuery() { |
|
|
|
resetQuery() { |
|
|
|
this.dateRange = []; |
|
|
|
this.dateRange = []; |
|
|
|
this.resetForm("queryForm"); |
|
|
|
this.resetForm("queryForm"); |
|
|
|
this.queryParams.deptId = undefined; |
|
|
|
|
|
|
|
this.$refs.tree.setCurrentKey(null); |
|
|
|
|
|
|
|
this.handleQuery(); |
|
|
|
this.handleQuery(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 多选框选中数据 |
|
|
|
// 多选框选中数据 |
|
|
|