bus_user.vue
4.01 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
<template>
<div class="sys-container">
<form ref="form" label-width="80px">
<el-row :gutter="10">
<el-col :span="3.5">
<div class="sys-form-item bg-purple">
<div class="sys-form-item-text">用户编码:</div>
<div class="sys-form-item-input">
<el-input v-model="paramsQuery.queryConfig.UserCode" placeholder="请输入用户编码" />
</div>
</div>
</el-col>
<el-col :span="3.5">
<div class="sys-form-item bg-purple">
<div class="sys-form-item-text">用户名称:</div>
<div class="sys-form-item-input">
<el-input v-model="paramsQuery.queryConfig.UserName" placeholder="请输入用户名称" />
</div>
</div>
</el-col>
<el-col :span="4">
<div class="sys-form-item bg-purple">
<el-button icon="el-icon-search" @click="btnAction(1)" type="primary">查询</el-button>
<el-button icon="el-icon-refresh-right" @click="btnAction(0)" type="primary">重置</el-button>
</div>
</el-col>
</el-row>
</form>
<!-- table -->
<div class="sys-table-border">
<el-table :data="tableData" style="width: 100%" height="700"
:header-cell-style="{ background: '#d9ebfe', color: '#000000' }">
<el-table-column type="selection" align="center" width="55"></el-table-column>
<el-table-column prop="id" label="id" v-if="false"></el-table-column>
<el-table-column prop="userCode" label="用户编码"> </el-table-column>
<el-table-column prop="userName" label="用户名称"> </el-table-column>
<el-table-column prop="department" label="部门"> </el-table-column>
<el-table-column prop="address" label="地址"> </el-table-column>
<el-table-column prop="phone" label="电话"> </el-table-column>
<el-table-column prop="remark" label="备注"> </el-table-column>
<el-table-column prop="errorCode" label="备注"> </el-table-column>
<el-table-column prop="created" label="创建时间" width="180"> </el-table-column>
<el-table-column prop="createdBy" label="创建人"> </el-table-column>
</el-table>
<div class="sys-pagination-container">
<el-pagination background layout="prev, pager, next" :current-page="paramsQuery.PageNumber"
:page-size="paramsQuery.PerPageCount" :total="paramsQuery.PageTotal" @current-change="handleCurrentChange">
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { getUserData } from "@/api/systemPermission/user";
export default {
data() {
const initialData = {
PageNumber: 1,
PerPageCount: 30,
queryConfig: {
UserCode: "",
UserName: "",
},
PageTotal: 0,
};
return {
tableData: [],
paramsQuery: { ...initialData },
initialData: JSON.parse(JSON.stringify(initialData))
};
},
methods: {
btnAction(flag) {
//重置
if (flag == 0) {
this.paramsQuery = JSON.parse(JSON.stringify(this.initialData));
}
this.getData();
},
getData() {
getUserData(this.paramsQuery).then(response => {
this.total = response.data.totalCount;
this.tableData = response.data.data;
});
},
//获取表格行数据
handleSelectionChange(val) {
this.multipleSelection = val;
},
//分页
handleCurrentChange(page) {
debugger
this.queryConfig.currentPage = page;
this.getData();
},
},
mounted() {
this.getData();
},
};
</script>
<style scoped lang="scss">
.sys-container {
width: 100%;
}
.el-row {
margin-bottom: 5px;
}
.sys-form-item {
display: flex;
border-radius: 4px;
min-height: 46px;
margin-bottom: 10px;
align-items: center;
}
.sys-table-border {
border: 1px solid #e5e9f2;
}
.T1 {
border: 1px solid #b3d8ff;
}
.sys-pagination-container {
text-align: center;
/* 使分页组件靠右 */
margin-top: 20px;
/* 添加顶部间距 */
}
</style>