|
@@ -1,39 +1,108 @@
|
|
<template>
|
|
<template>
|
|
<div class="user-page">
|
|
<div class="user-page">
|
|
- <transition name="el-fade-in-linear">
|
|
|
|
- <Query v-show="userModulesView == 0"></Query>
|
|
|
|
- </transition>
|
|
|
|
- <transition name="el-fade-in-linear">
|
|
|
|
- <Record v-show="userModulesView == 1"></Record>
|
|
|
|
- </transition>
|
|
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" class="padding20">
|
|
|
|
+ <el-form :inline="true" :model="searchForm" class="demo-form-inline" size="small">
|
|
|
|
+ <el-form-item label="用户昵称">
|
|
|
|
+ <el-input v-model="searchForm.nickname" placeholder="请输入用户昵称"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="手机号">
|
|
|
|
+ <el-input v-model="searchForm.phone" placeholder="请输入手机号"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="handleQuery">查询</el-button>
|
|
|
|
+ <el-button @click="handleReset">重置</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" class="padding20">
|
|
|
|
+ <el-table :data="tableData" border stripe style="width: 100%" size="small" height="700" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading">
|
|
|
|
+ <el-table-column type="index" align="center" label="序号"></el-table-column>
|
|
|
|
+ <el-table-column prop="userId" align="center" label="用户ID"></el-table-column>
|
|
|
|
+ <el-table-column prop="headImg" align="center" label="头像">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-avatar :size="40" :src="scope.row.headImg">
|
|
|
|
+ <img src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"/>
|
|
|
|
+ </el-avatar>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="nickname" align="center" label="昵称"></el-table-column>
|
|
|
|
+ <el-table-column prop="phone" align="center" label="手机号"></el-table-column>
|
|
|
|
+ <el-table-column prop="addTime" align="center" label="注册时间"></el-table-column>
|
|
|
|
+ <el-table-column prop="documentNum" align="center" label="文档数"></el-table-column>
|
|
|
|
+ <el-table-column prop="examinationNum" align="center" label="体验次数"></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" class="padding20 flexend" >
|
|
|
|
+ <el-pagination
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
+ layout="total, prev, pager, next"
|
|
|
|
+ :total="total"
|
|
|
|
+ size="small"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import Query from './query'
|
|
|
|
-import Record from './recoed'
|
|
|
|
-import { mapState } from 'vuex'
|
|
|
|
|
|
+import { getUserList } from '../../../request/request'
|
|
export default {
|
|
export default {
|
|
name: 'user',
|
|
name: 'user',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
|
|
+ loading: false,
|
|
|
|
+ searchForm: {
|
|
|
|
+ nickname: '',
|
|
|
|
+ phone: ''
|
|
|
|
+ },
|
|
|
|
+ tableData: [],
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ total: 0
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- ...mapState({
|
|
|
|
- userModulesView: s => s.userModulesView
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- components: {
|
|
|
|
- Query,
|
|
|
|
- Record
|
|
|
|
- },
|
|
|
|
mounted() {
|
|
mounted() {
|
|
- console.log('user mounted', this.userModulesView, this.$store);
|
|
|
|
|
|
+ this.handleQuery()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
|
|
+ handleReset () {
|
|
|
|
+ this.searchForm.nickname = ''
|
|
|
|
+ this.searchForm.phone = ''
|
|
|
|
+ },
|
|
|
|
+ handleQuery () {
|
|
|
|
+ this.currentPage = 1
|
|
|
|
+ this.getUserListFn()
|
|
|
|
+ },
|
|
|
|
+ getUserListFn () {
|
|
|
|
+ let data = {
|
|
|
|
+ currentPage: this.currentPage,
|
|
|
|
+ nickname: this.searchForm.nickname,
|
|
|
|
+ phone: this.searchForm.phone
|
|
|
|
+ }
|
|
|
|
+ this.loading = true
|
|
|
|
+ getUserList(data).then(res => {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.total = res.data.total
|
|
|
|
+ this.pageSize = res.data.pageSize
|
|
|
|
+ this.tableData = res.data.vos || []
|
|
|
|
+ }).catch(e => {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.tableData = []
|
|
|
|
+ console.log(e);
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange (currentPage) {
|
|
|
|
+ this.currentPage = currentPage
|
|
|
|
+ this.getUserListFn()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -42,5 +111,12 @@ export default {
|
|
.user-page {
|
|
.user-page {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
|
|
+ .padding20 {
|
|
|
|
+ padding: 20px;
|
|
|
|
+ }
|
|
|
|
+ .flexend {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|