|
|
@@ -1,114 +0,0 @@
|
|
|
-<template>
|
|
|
- <schema-table
|
|
|
- ref="table"
|
|
|
- :schema="schema"
|
|
|
- >
|
|
|
- <template #pagination="{ options, pagination }">
|
|
|
- <div class="l-flex__none u-text--center">
|
|
|
- <el-button-group
|
|
|
- v-if="options.params.pageNum > 1 || options.totalCount > options.params.pageSize"
|
|
|
- class="has-top-padding"
|
|
|
- >
|
|
|
- <el-button
|
|
|
- class="o-pagination-button"
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- :disabled="options.params.pageNum === 1"
|
|
|
- @click="onFirstPage(options, pagination)"
|
|
|
- >
|
|
|
- 首页
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- class="o-pagination-button"
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- icon="el-icon-arrow-left"
|
|
|
- :disabled="options.params.pageNum === 1"
|
|
|
- @click="onPresentPage(options, pagination)"
|
|
|
- >
|
|
|
- 上一页
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- class="o-pagination-button"
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- :disabled="options.totalCount <= options.params.pageSize"
|
|
|
- @click="onNextPage(options, pagination)"
|
|
|
- >
|
|
|
- 下一页
|
|
|
- <i class="el-icon-arrow-right el-icon--right" />
|
|
|
- </el-button>
|
|
|
- </el-button-group>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <c-dialog
|
|
|
- ref="dialog"
|
|
|
- size="medium"
|
|
|
- title="设置"
|
|
|
- >
|
|
|
- <template #default>
|
|
|
- <settings :user="user" />
|
|
|
- </template>
|
|
|
- </c-dialog>
|
|
|
- </schema-table>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { getUsersByGroup } from '@/api/user'
|
|
|
-import Settings from './Settings'
|
|
|
-
|
|
|
-export default {
|
|
|
- name: 'Account',
|
|
|
- components: {
|
|
|
- Settings
|
|
|
- },
|
|
|
- props: {
|
|
|
- group: {
|
|
|
- type: Object,
|
|
|
- required: true
|
|
|
- }
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- schema: {
|
|
|
- list: this.getUsersByGroup,
|
|
|
- cols: [
|
|
|
- { prop: 'username', label: '账号' },
|
|
|
- { type: 'invoke', render: [
|
|
|
- { label: '设置', on: this.onSettings }
|
|
|
- ] }
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- group () {
|
|
|
- this.$refs.table.pageTo(1)
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getUsersByGroup (params) {
|
|
|
- return getUsersByGroup({
|
|
|
- id: this.group.id,
|
|
|
- ...params
|
|
|
- })
|
|
|
- },
|
|
|
- onFirstPage (options, pagination) {
|
|
|
- options.params.pageNum = 1
|
|
|
- pagination()
|
|
|
- },
|
|
|
- onPresentPage (options, pagination) {
|
|
|
- options.params.pageNum -= 1
|
|
|
- pagination()
|
|
|
- },
|
|
|
- onNextPage (options, pagination) {
|
|
|
- options.params.pageNum += 1
|
|
|
- pagination()
|
|
|
- },
|
|
|
- onSettings (user) {
|
|
|
- this.user = user
|
|
|
- this.$refs.dialog.show()
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|