userlist.vue
3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<template>
<div class="app-container">
<div class="seetingsDiv" style="">
<div class="flex">
<el-input placeholder="输入关键字搜索" v-model="query.keyword"></el-input>
<el-button type="success" @click="search">搜索</el-button>
<el-button v-if="selectedList.length" type="primary" @click="handleInviteInterview"
>邀请面试</el-button
>
</div>
<el-upload
class="upload-demo"
action="/api/Account/ImportUser"
multiple
:limit="3"
:on-exceed="handleExceed"
:file-list="fileList"
>
<el-button size="small" type="primary">导入用户</el-button>
</el-upload>
</div>
<el-table
:data="userList"
id="QuestionTable"
border
style="
width: 100%;
border-radius: 5px;
box-shadow: 0 0 10px #efefef;
margin-top: 10px;
"
@selection-change="handleSelectionChange"
:stripe="true"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column
type="index"
prop="date"
width="50"
align="center"
></el-table-column>
<el-table-column prop="date" label="用户昵称">
<template slot-scope="scope">
<span>{{ scope.row.fullName }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="电话号码">
<template slot-scope="scope">
<el-tooltip
class="item"
effect="dark"
:content="scope.row.phone"
placement="top-start"
>
<span>{{ scope.row.phone1 }}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="date" label="注册时间">
<template slot-scope="scope">
<span>{{ scope.row.addTime.replace("T", " ") }}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@current-change="currentchange"
style="position: static; bottom: 3px; text-align: center; margin-top: 5px"
:page-size="this.query.PageSize"
layout="total,prev, pager, next"
:total="Count"
>
</el-pagination>
</div>
</template>
<script>
import { ImportUserByExcel, GetUserList } from "@/api/user";
export default {
data() {
return {
userList: [],
Count: 0,
type: "1",
query: {
UserTypeEnum: 1, //0:管理员,1普通用户
PageIndex: 1,
PageSize: 10,
keyword:''
},
fileList:[],
selectedList: [],
};
},
created() {
this.GetUser();
},
methods: {
search(){
this.GetUser();
},
handleInviteInterview() {},
handleSelectionChange(val) {
console.log(val);
this.selectedList = val;
},
handleExceed(){},
ImportUser() {},
GetUser() {
GetUserList(this.query).then((res) => {
this.userList = res.data.data.rows.map((t) => {
if (t.phone) {
t.phone1 = t.phone.replace(t.phone.substring(3, 7), "****");
}
return t;
});
this.Count = res.data.data.total;
});
},
currentchange(page) {
this.query.PageIndex = page;
this.GetUser();
},
},
};
</script>
<style lang="scss" scoped>
.seetingsDiv {
display: flex;
align-items: center;
width: 100%;
height: 60px;
background: #efefef;
line-height: 60px;
border-radius: 5px;
box-shadow: 0 0 5px #cdcdcd;
justify-content: space-between;
}
.seetingsDiv button {
height: 40px;
background-color: #304156;
border: 0px;
margin-left: 10px;
box-shadow: 0 0 5px #cdcdcd;
float: none;
margin-right: 10px;
}
</style>