UserProfile.vue 2.6 KB
Newer Older
E
Evan 已提交
1
<template>
2 3 4 5 6 7 8 9
  <div>
    <el-row style="margin: 18px 0px 0px 18px ">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/admin' }">管理中心</el-breadcrumb-item>
        <el-breadcrumb-item>用户管理</el-breadcrumb-item>
        <el-breadcrumb-item>用户信息</el-breadcrumb-item>
      </el-breadcrumb>
    </el-row>
E
Evan 已提交
10 11
    <el-card style="margin: 18px 2%;width: 95%">
      <el-table
E
Evan 已提交
12
        :data="users"
E
Evan 已提交
13 14 15 16
        stripe
        style="width: 100%"
        :max-height="tableHeight">
        <el-table-column
E
Evan 已提交
17 18
          type="selection"
          width="55">
E
Evan 已提交
19 20
        </el-table-column>
        <el-table-column
E
Evan 已提交
21
          prop="id"
E
Evan 已提交
22 23 24 25
          label="id"
          width="100">
        </el-table-column>
        <el-table-column
E
Evan 已提交
26
          prop="username"
E
Evan 已提交
27
          label="用户名"
E
Evan 已提交
28
          fit>
E
Evan 已提交
29 30
        </el-table-column>
        <el-table-column
E
Evan 已提交
31
          prop="name"
E
Evan 已提交
32
          label="真实姓名"
E
Evan 已提交
33
          fit>
E
Evan 已提交
34 35
        </el-table-column>
        <el-table-column
E
Evan 已提交
36
          prop="phone"
E
Evan 已提交
37
          label="手机号"
E
Evan 已提交
38
          fit>
E
Evan 已提交
39 40
        </el-table-column>
        <el-table-column
E
Evan 已提交
41 42 43
          prop="email"
          label="邮箱"
          fit>
E
Evan 已提交
44 45
        </el-table-column>
        <el-table-column
E
Evan 已提交
46
          prop="status"
E
Evan 已提交
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
          label="状态"
          width="100">
        </el-table-column>
        <el-table-column
          label="操作"
          width="120">
          <template slot-scope="scope">
            <el-button
              @click.native.prevent="editBook(scope.row)"
              type="text"
              size="small">
              编辑
            </el-button>
            <el-button
              @click.native.prevent="deleteBook(scope.row.id)"
              type="text"
              size="small">
              移除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
E
Evan 已提交
69 70 71 72
      <div style="margin: 20px 0 20px 0;float: left">
        <el-button>取消选择</el-button>
        <el-button>批量删除</el-button>
      </div>
E
Evan 已提交
73
    </el-card>
74
  </div>
E
Evan 已提交
75 76 77 78
</template>

<script>
    export default {
E
Evan 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
        name: 'UserProfile',
      data () {
          return {
            users: []
          }
      },
      mounted () {
        this.listUsers()
      },
      computed: {
        tableHeight () {
          return window.innerHeight - 320
        }
      },
      methods: {
        listUsers () {
          var _this = this
          this.$axios.get('/admin/user').then(resp => {
            if (resp && resp.status === 200) {
              _this.users = resp.data
            }
          })
        }
      }
E
Evan 已提交
103 104 105 106 107 108
    }
</script>

<style scoped>

</style>