|
@@ -6,29 +6,27 @@
|
|
|
<div class="head-container">
|
|
|
<el-input
|
|
|
v-model="deptName"
|
|
|
- placeholder="请输入部门名称"
|
|
|
+ placeholder="请选择下方部门名称查询"
|
|
|
clearable
|
|
|
size="small"
|
|
|
- prefix-icon="el-icon-search"
|
|
|
style="margin-bottom: 20px"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div class="head-container">
|
|
|
+ <div class="head-container head-container2" style="height:calc(100vh - 200px)">
|
|
|
<el-tree
|
|
|
:data="deptOptions"
|
|
|
:props="defaultProps"
|
|
|
:expand-on-click-node="false"
|
|
|
:filter-node-method="filterNode"
|
|
|
ref="tree"
|
|
|
- default-expand-all
|
|
|
@node-click="handleNodeClick"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<!--用户数据-->
|
|
|
<el-col :span="20" :xs="24">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="登录账户" prop="loginName">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
|
|
|
+ <el-form-item label="登录账户:" prop="loginName">
|
|
|
<el-input
|
|
|
v-model="queryParams.loginName"
|
|
|
placeholder="请输入登录账户"
|
|
@@ -38,7 +36,7 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="手机号码" prop="phonenumber">
|
|
|
+ <el-form-item label="手机号码:" prop="phonenumber">
|
|
|
<el-input
|
|
|
v-model="queryParams.phonenumber"
|
|
|
placeholder="请输入手机号码"
|
|
@@ -48,7 +46,7 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="用户状态" prop="status">
|
|
|
+ <el-form-item label="用户状态:" prop="status">
|
|
|
<el-select
|
|
|
v-model="queryParams.status"
|
|
|
placeholder="用户状态"
|
|
@@ -64,7 +62,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="创建时间" style="margin-top:-2px">
|
|
|
+ <el-form-item label="创建时间:" >
|
|
|
<el-date-picker
|
|
|
v-model="dateRange"
|
|
|
size="small"
|
|
@@ -73,31 +71,33 @@
|
|
|
range-separator="-"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
+ style="margin-left:0px;"
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
+ <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ <el-col :span="1.5">
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
+ type="success"
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
>新增</el-button>
|
|
|
</el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <!-- <el-row :gutter="10" class="mb8">
|
|
|
+
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
- </el-row>
|
|
|
- <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column label="用户ID" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
|
|
- <el-table-column label="登录账户" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="部门" align="center" key="deptName" prop="deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" />
|
|
|
+ </el-row> -->
|
|
|
+ <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" :max-height="tableHeight">
|
|
|
+ <el-table-column label="用户ID" align="center" key="userId" prop="userId" v-if="columns[0].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="登录账户" align="center" key="userName" prop="userName" v-if="columns[1].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[1].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="部门" align="center" key="deptName" prop="deptName" v-if="columns[3].visible" show-overflow-tooltip />
|
|
|
+ <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" show-overflow-tooltip/>
|
|
|
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch
|
|
@@ -108,7 +108,7 @@
|
|
|
></el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.createTime }}</span>
|
|
|
</template>
|
|
@@ -157,7 +157,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="归属部门" prop="deptId">
|
|
|
- <treeselect v-model="form.deptId" :options="deptOptions" placeholder="请选择归属部门" />
|
|
|
+ <treeselect v-model="form.deptId" :options="deptOptions" placeholder="请选择归属部门" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -169,7 +169,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="邮箱" prop="email">
|
|
|
- <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
|
|
+ <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="40" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -262,6 +262,7 @@
|
|
|
:page-size="pageSize"
|
|
|
layout="sizes,prev, pager, next"
|
|
|
:total="totalCount"
|
|
|
+ style="position:fixed;"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
|
|
@@ -299,11 +300,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate,
|
|
|
-import {userList, userEdit, resetPwd, userAdd, userRemove} from "@/api/system/user";
|
|
|
+import {userList, userEdit, resetPwd, userAdd, userRemove,} from "@/api/system/user";
|
|
|
import { roleList } from '@/api/system/auth-manage'
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
-import { Message, MessageBox } from 'element-ui'
|
|
|
+import { Message } from 'element-ui'
|
|
|
import { treeselect } from "@/api/system/orgnization";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
@@ -472,7 +472,8 @@ export default {
|
|
|
{ required: true, message: "用户角色不能为空", trigger: "change"},
|
|
|
],
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ tableHeight:undefined,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -481,6 +482,19 @@ export default {
|
|
|
this.$refs.tree.filter(val);
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ // table高度
|
|
|
+ if(window.innerWidth <1920){
|
|
|
+ this.tableHeight = window.innerHeight - 300
|
|
|
+ }else{
|
|
|
+ this.tableHeight = window.innerHeight - 295
|
|
|
+ }
|
|
|
+ // 监听窗口大小变化
|
|
|
+ let self = this;
|
|
|
+ window.onresize = function() {
|
|
|
+ self.tableHeight = window.innerHeight - 300
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getList();
|
|
|
this.getTreeselect();
|
|
@@ -495,6 +509,7 @@ export default {
|
|
|
// });
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
/** 查询用户列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -511,7 +526,6 @@ export default {
|
|
|
}
|
|
|
this.loading = false;
|
|
|
});
|
|
|
- this.reset()
|
|
|
},
|
|
|
/** 查询部门下拉树结构 */
|
|
|
getTreeselect() {
|
|
@@ -548,14 +562,28 @@ export default {
|
|
|
},
|
|
|
// 用户状态修改
|
|
|
handleStatusChange(value,row) {
|
|
|
- let _this = this
|
|
|
+ let that = this
|
|
|
let text = row.status === "0" ? "启用" : "停用";
|
|
|
- this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', "警告", {
|
|
|
+ this.$confirm('确认要"' + text + '""' + row.loginName + '"用户吗?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(function() {
|
|
|
- _this.useredit("statue",value,row)
|
|
|
+ userList({loginName:row.loginName}).then(response => {
|
|
|
+ let arr = []
|
|
|
+ arr = response.data.pageList[0]
|
|
|
+ arr.params = undefined
|
|
|
+ arr.status = row.status
|
|
|
+ userEdit(arr).then(response => {
|
|
|
+ if(response.status == "SUCCESS"){
|
|
|
+ Message({
|
|
|
+ message: ("账号'" + row.loginName + "'" + text + "成功"),
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
}).catch(function() {
|
|
|
row.status = row.status === "0" ? "1" : "0";
|
|
|
});
|
|
@@ -601,18 +629,25 @@ export default {
|
|
|
this.queryParams ={}
|
|
|
// this.resetForm("form");
|
|
|
},
|
|
|
- /** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNo = 1;
|
|
|
- this.queryParams.pageSize = 15;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.dateRange = [];
|
|
|
- this.resetForm("queryForm");
|
|
|
+ this.queryParams = {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 15,
|
|
|
+ userName: undefined,
|
|
|
+ phonenumber: undefined,
|
|
|
+ status: undefined,
|
|
|
+ deptId: undefined,
|
|
|
+ endTime:undefined,
|
|
|
+ startTime:undefined
|
|
|
+ }
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.userId);
|
|
@@ -698,17 +733,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
- // this.roleOptions
|
|
|
-
|
|
|
- // :label="item.roleName"
|
|
|
- // :value="item.roleId"
|
|
|
- // :disabled="item.status == 1"
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
+ // this.reset();
|
|
|
this.getTreeselect();
|
|
|
this.roleIds()
|
|
|
const loginName = row.loginName;
|
|
@@ -736,12 +764,12 @@ export default {
|
|
|
if(this.form.deptName){
|
|
|
if(this.deptOptions){
|
|
|
for(let i = 0;i<this.deptOptions.length;i++){
|
|
|
- if(this.form.deptName == this.deptOptions[i].label){
|
|
|
+ if(this.form.deptName = this.deptOptions[i].label){
|
|
|
this.form.deptId = this.deptOptions[i].label
|
|
|
}
|
|
|
if(this.deptOptions[i].children){
|
|
|
for(let a = 0;a<this.deptOptions[i].children.length;a++){
|
|
|
- if(this.form.deptName == this.deptOptions[i].children[a].label){
|
|
|
+ if(this.form.deptName = this.deptOptions[i].children[a].label){
|
|
|
this.form.deptId = this.deptOptions[i].children[a].label
|
|
|
}
|
|
|
}
|
|
@@ -1017,4 +1045,7 @@ export default {
|
|
|
height:32px;
|
|
|
line-height: 32px;
|
|
|
}
|
|
|
+.head-container2{
|
|
|
+ overflow-y: scroll;
|
|
|
+}
|
|
|
</style>
|