| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="main_app"> |
| | | <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear"> |
| | | </QueryForm> |
| | | <el-table v-loading="loading" :data="list" stripe row-key="id" class="mb20" default-expand-all> |
| | | <el-table-column prop="realname" label="å§å" min-width="100"></el-table-column> |
| | | <el-table-column prop="mobile" label="ææºå·" min-width="100"></el-table-column> |
| | | </el-table> |
| | | <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/common/Pagination' |
| | | import QueryForm from '@/components/common/QueryForm' |
| | | import { fetchList } from '@/api/system/user.js' |
| | | export default { |
| | | components: { |
| | | QueryForm, |
| | | Pagination |
| | | }, |
| | | data() { |
| | | return { |
| | | filters: {}, |
| | | list: [], |
| | | queryFormConfig: { |
| | | formItems: [ |
| | | { |
| | | type: 'input', |
| | | filed: 'realname', |
| | | label: 'å§å' |
| | | }, |
| | | { |
| | | type: 'input', |
| | | filed: 'username', |
| | | label: 'ææºå·' |
| | | }, |
| | | ], |
| | | online: true |
| | | }, |
| | | pagination: { |
| | | capacity: 10, |
| | | page: 1, |
| | | total: 0, |
| | | }, |
| | | loading: false, |
| | | } |
| | | }, |
| | | created() { |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | getList(page) { |
| | | const { filters, pagination } = this |
| | | pagination.page = page || pagination.page |
| | | fetchList({ |
| | | model: { |
| | | ...filters, |
| | | memberType: 0 |
| | | }, |
| | | ...pagination |
| | | }).then(res => { |
| | | console.log('res', res) |
| | | this.list = res.records || [] |
| | | this.pagination.total = res.total || 0 |
| | | }) |
| | | }, |
| | | clear() { |
| | | this.filters = {} |
| | | this.getList(0) |
| | | }, |
| | | handleSizeChange(capacity) { |
| | | this.pagination.capacity = capacity |
| | | this.getList(0) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |