<template>
  <div class="app-container">
    <!-- <el-upload class="upload-demo" action="/api/Account/ImportUser" :on-preview="handlePreview"
      :on-remove="handleRemove" :before-remove="beforeRemove" multiple :limit="3" :on-exceed="handleExceed"
      :file-list="fileList">
      <el-button size="small" type="primary">导入用户</el-button>
    </el-upload> -->
    <el-table :data="userList" id="QuestionTable" border
      style="width: 100%;border-radius: 5px;box-shadow: 0 0 10px #efefef;margin-top: 10px;" :stripe='true'>
      <el-table-column type="index" prop="date" width="50" align="center"></el-table-column>
      <el-table-column prop="date" label="用户昵称">
        <template slot-scope="scope">
          <span>{{ scope.row.fullName }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="date" label="电话号码">
        <template slot-scope="scope">
          <el-tooltip class="item" effect="dark" :content="scope.row.phone " placement="top-start">
            <span>{{ scope.row.phone1 }}</span>
          </el-tooltip>

        </template>
      </el-table-column>

      <el-table-column prop="date" label="注册时间">
        <template slot-scope="scope">
          <span>{{ scope.row.addTime.replace('T',' ') }}</span>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination background @current-change="currentchange"
      style="position:static;bottom: 3px;text-align: center;margin-top: 5px;" :page-size="this.query.PageSize"
      layout="total,prev, pager, next" :total="Count">
    </el-pagination>

  </div>
</template>

<script>
  import {
    ImportUserByExcel,
    GetUserList
  } from '@/api/user'
  export default {
    data() {
      return {
        userList: [],
        Count: 0,
        type: '1',
        query: {
          UserTypeEnum: 1, //0：管理员，1普通用户
          PageIndex: 1,
          PageSize: 10,

        }
      }
    },
    created() {
      this.GetUser()
    },
    methods: {
      ImportUser() {

      },
      GetUser() {
        GetUserList(this.query).then(res => {
          this.userList = res.data.data.rows.map(t => {
          if(t.phone){
            t.phone1 = t.phone.replace(t.phone.substring(3, 7),'****')
          }
            return t
          })
          this.Count = res.data.data.total
        })
      },
      currentchange(page) {
        this.query.PageIndex = page;
        this.GetUser();
      },
    }
  }
</script>

<style>
</style>
