提交 | 用户 | age
|
2a61f6
|
1 |
<template> |
L |
2 |
<div class="app-container"> |
|
3 |
<!-- 搜索区 ↓↓↓↓↓↓↓↓↓↓ --> |
|
4 |
<el-form v-show="showSearch" ref="searchForm" :inline="true"> |
|
5 |
<el-form-item label="管理员账号"> |
|
6 |
<el-input |
|
7 |
v-model="keyWord" |
|
8 |
placeholder="请输入管理员账号" |
|
9 |
clearable |
|
10 |
size="small" |
|
11 |
style="width: 240px" |
36b711
|
12 |
maxlength="10" |
2a61f6
|
13 |
@keyup.enter.native="reGetList" |
L |
14 |
/> |
|
15 |
</el-form-item> |
|
16 |
<el-form-item> |
|
17 |
<el-button type="cyan" icon="el-icon-search" size="mini" @click="reGetList">搜索</el-button> |
|
18 |
<el-button icon="el-icon-refresh" size="mini" @click="resetHandle">重置</el-button> |
|
19 |
</el-form-item> |
|
20 |
</el-form> |
|
21 |
<!-- 搜索区 ↑↑↑↑↑↑↑↑↑↑ --> |
|
22 |
|
|
23 |
<el-table :data="list"> |
|
24 |
<el-table-column type="index" label="序号" align="center" width="60" /> |
|
25 |
<el-table-column label="管理员账号" prop="admin" align="center" min-width="120" /> |
|
26 |
<el-table-column label="操作名称" prop="opName" align="center" min-width="120" /> |
|
27 |
<el-table-column label="操作时间" prop="createTime" align="center" min-width="120" /> |
|
28 |
</el-table> |
|
29 |
|
|
30 |
<pagination |
|
31 |
v-show="total>0" |
|
32 |
:total="total" |
|
33 |
:page.sync="pageNum" |
|
34 |
:limit.sync="pageSize" |
|
35 |
@pagination="getList" |
|
36 |
/> |
|
37 |
</div> |
|
38 |
</template> |
|
39 |
|
|
40 |
<script> |
|
41 |
|
|
42 |
export default { |
|
43 |
name: 'Role', |
|
44 |
data() { |
|
45 |
return { |
|
46 |
showSearch: true, // 是否显示搜索区 |
|
47 |
keyWord: '', |
|
48 |
|
|
49 |
list: [], |
|
50 |
|
|
51 |
// 分页 ↓↓↓↓↓↓↓↓↓↓ |
|
52 |
total: 0, |
|
53 |
pageNum: 1, |
|
54 |
pageSize: 20 |
|
55 |
// 分页 ↑↑↑↑↑↑↑↑↑↑ |
|
56 |
} |
|
57 |
}, |
|
58 |
mounted() { |
|
59 |
this.init() |
|
60 |
}, |
|
61 |
methods: { |
|
62 |
// 初始化 |
|
63 |
init() { |
|
64 |
this.getList() |
|
65 |
}, |
|
66 |
|
|
67 |
// 获取列表 |
|
68 |
getList() { |
|
69 |
var { pageNum, pageSize, keyWord } = this |
|
70 |
this.postFN({ |
|
71 |
url: 'admin/op/list', |
|
72 |
params: { |
|
73 |
pageNum: pageNum, |
efd7c8
|
74 |
pageSize: pageSize, |
2a61f6
|
75 |
keyWord: keyWord |
L |
76 |
}, |
|
77 |
mockData: { |
|
78 |
code: 100, |
|
79 |
msg: '', |
|
80 |
data: { |
|
81 |
list: [{ |
|
82 |
id: 'xxx', |
|
83 |
index: 1, |
|
84 |
admin: '电子产品', |
|
85 |
createTime: '2020-08-05 10:00:05', |
|
86 |
opName: '登陆' |
|
87 |
}], |
|
88 |
total: 100 |
|
89 |
} |
|
90 |
} |
|
91 |
}, (inf) => { |
|
92 |
this.list = inf.list || [] |
|
93 |
this.total = inf.total |
|
94 |
}) |
|
95 |
}, |
|
96 |
// 重新获取列表 |
|
97 |
reGetList() { |
|
98 |
this.pageNum = 1 |
|
99 |
this.getList() |
|
100 |
}, |
|
101 |
// 重置 |
|
102 |
resetHandle() { |
|
103 |
this.keyWord = '' |
|
104 |
this.reGetList() |
|
105 |
} |
|
106 |
} |
|
107 |
} |
|
108 |
</script> |
|
109 |
|
|
110 |
<style lang="scss" scoped> |
|
111 |
|
|
112 |
</style> |