<template>
|
<div class="userList">
|
<div class="header">用户列表</div>
|
<div class="content">
|
<div class="search">
|
<div class="label">用户名/手机号</div>
|
<el-input v-model="input" placeholder="请输入内容"></el-input>
|
<div class="label">注册时间</div>
|
<el-date-picker
|
v-model="time"
|
type="daterange"
|
range-separator="至"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
>
|
</el-date-picker>
|
<div class="button" @click="getUserList">搜索</div>
|
</div>
|
|
<div class="table-area">
|
<el-table
|
id="multipleTable"
|
ref="multipleTable"
|
:data="dataList"
|
tooltip-effect="dark"
|
:fit="true"
|
>
|
<el-table-column label="序号" width="68">
|
<template slot-scope="scope">{{
|
scope.$index + 1 + (page - 1) * size
|
}}</template>
|
</el-table-column>
|
<el-table-column prop="username" label="用户名"></el-table-column>
|
|
<el-table-column prop="phoneNum" label="手机号"></el-table-column>
|
<el-table-column prop="userType" label="类型" sortable>
|
<template slot-scope="scope">{{
|
scope.row.userType == 2 ? "公司" : "个人"
|
}}</template>
|
</el-table-column>
|
<el-table-column
|
prop="trueName"
|
label="姓名/联系人"
|
></el-table-column>
|
<el-table-column
|
prop="createTime"
|
label="注册时间"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="lastLoginTime"
|
label="最后登录时间"
|
sortable
|
></el-table-column>
|
|
<el-table-column label="操作">
|
<template slot-scope="scope">
|
<div class="control" @click="checkDetail(scope.row)">
|
查看详情
|
</div>
|
</template>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
@current-change="refrash"
|
@size-change="handleSizeChange"
|
:current-page="page"
|
:page-size="size"
|
layout=" prev, pager, next, jumper"
|
:total="total"
|
background
|
></el-pagination>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { findUserList } from "@/api/user";
|
export default {
|
created() {
|
this.getUserList();
|
},
|
data() {
|
return {
|
input: "",
|
time: [],
|
page: 1,
|
size: 10,
|
total: 20,
|
dataList: [],
|
};
|
},
|
methods: {
|
async getUserList() {
|
const res = await findUserList({
|
page: this.page,
|
size: this.size,
|
type: 0,
|
startTime: this.time && this.time[0],
|
endTime: this.time && this.time[1],
|
inputText: this.input,
|
});
|
if (res && res.success) {
|
this.dataList = res.data.list;
|
this.total = res.data.total;
|
}
|
},
|
refrash(page) {
|
this.page = page;
|
this.getUserList();
|
},
|
handleSizeChange(size) {
|
this.size = size;
|
this.getUserList();
|
},
|
checkDetail(row) {
|
this.$router.push({
|
path: "/Layout/UserDetail",
|
query: { type: row.type, username: row.username, userId: row.id },
|
});
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.userList {
|
background-color: rgb(243, 245, 248);
|
.header {
|
padding: 0 24px;
|
height: 50px;
|
font-size: 16px;
|
color: #666666;
|
line-height: 50px;
|
background: #ffffff;
|
font-weight: 700;
|
}
|
|
.content {
|
margin: 24px;
|
padding: 20px;
|
background-color: #fff;
|
|
.search {
|
display: flex;
|
align-items: center;
|
line-height: 23px;
|
|
.label {
|
margin-right: 20px;
|
height: 20px;
|
font-size: 14px;
|
color: #3d3d3d;
|
}
|
|
.el-input ::v-deep {
|
margin-right: 30px;
|
width: 300px;
|
height: 32px;
|
.el-input__inner {
|
width: 100%;
|
height: 32px;
|
line-height: 32px;
|
color: #3d3d3d;
|
border-radius: 0;
|
border-color: #c0c5cc;
|
&::-webkit-input-placeholder {
|
color: #999999;
|
}
|
|
&:focus {
|
border-color: #0065ff;
|
}
|
}
|
}
|
|
.el-date-editor ::v-deep {
|
box-sizing: border-box;
|
height: 32px;
|
|
.el-input__icon,
|
.el-input__suffix {
|
margin-top: -7px;
|
}
|
.el-range-separator {
|
line-height: 27px;
|
}
|
}
|
|
.button {
|
margin-left: 36px;
|
width: 60px;
|
height: 32px;
|
text-align: center;
|
border-radius: 3px;
|
background: #0064ff;
|
font-size: 14px;
|
line-height: 32px;
|
color: #ffffff;
|
cursor: pointer;
|
}
|
}
|
|
.control {
|
color: #0064ff;
|
cursor: pointer;
|
}
|
}
|
}
|
</style>
|