userlist.vue
2.45 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
<template>
<div class="app-container">
<!-- <el-upload class="upload-demo" action="/api/Account/ImportUser" :on-preview="handlePreview"
:on-remove="handleRemove" :before-remove="beforeRemove" multiple :limit="3" :on-exceed="handleExceed"
:file-list="fileList">
<el-button size="small" type="primary">导入用户</el-button>
</el-upload> -->
<el-table :data="userList" id="QuestionTable" border
style="width: 100%;border-radius: 5px;box-shadow: 0 0 10px #efefef;margin-top: 10px;" :stripe='true'>
<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,
}
}
},
created() {
this.GetUser()
},
methods: {
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>
</style>