123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <template>
- <div class="body" style="font-size:14px">
- <el-card class="box-card" shadow="never">
- 游戏名称:
- <el-input v-model="gameTitle" style="width: 200px; margin-right: 20px" />
- 用户昵称:
- <el-input v-model="nickName" style="width: 200px; margin-right: 20px" />
- 手机号:
- <el-input v-model="phone" style="width: 200px; margin-right: 20px" />
- 创建时间:
- <el-date-picker
- v-model="daterange"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd"
- style="margin-right: 20px"
- @change="dateChange"
- />
- <div style="float:right">
- <el-button type="primary" @click="onSearch">查询</el-button>
- <el-button @click="onReset">重置</el-button>
- </div>
- </el-card>
- <el-table stripe :data="tableData" border style="width: 100%">
- <el-table-column prop="gameTitle" label="游戏名称" />
- <el-table-column prop="resultMode" label="游戏类型">
- <template slot-scope="scope">
- {{
- scope.row.resultMode=='examination'?'测试':'匹配'
- }}
- </template>
- </el-table-column>
- <el-table-column prop="nickName" label="用户昵称" />
- <el-table-column prop="avatar" label="用户头像">
- <template slot-scope="scope">
- <el-image :src="scope.row.avatar" style="width: 100px; height: 100px" />
- </template>
- </el-table-column>
- <el-table-column prop="phone" label="手机号" />
- <el-table-column prop="score" label="答题分数" />
- <el-table-column prop="characterName" label="实例结果" />
- <el-table-column prop="createDate" label="参与时间">
- <template slot-scope="scope">
- {{
- scope.row.createDate.substr(0, 10)
- }}
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- v-show="gameTotal!==0"
- style="float:right; margin:20px 0"
- :total="gameTotal"
- :current-page="currentPage"
- :page-sizes="[4, 10, 20, 50]"
- :page-size="pageSize"
- layout="total, prev, pager, next, sizes"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- </template>
- <script>
- import { getGamePersonList } from '@/api/gamePerson'
-
- export default {
- data() {
- return {
- characterId: undefined,
- gameTitle: undefined,
- nickName: undefined,
- phone: undefined,
- daterange: undefined,
- tableData: [],
- endDate: undefined,
- startDate: undefined,
- //
- pageSize: 10,
- currentPage: 1,
- gameTotal: 0 // 条目总数
- }
- },
- mounted() {
- this.onSearch()
- },
- methods: {
- // 改变每页显示条数
- handleSizeChange(val) {
- this.pageSize = val
- this.changePagination()
- },
- // 改变页码
- handleCurrentChange(val) {
- this.currentPage = val
- this.changePagination()
- },
- // 改变分页组件重新查询数据
- changePagination() {
- getGamePersonList({
- gameTitle: this.gameTitle,
- nickName: this.nickName,
- phone: this.phone,
- startDate: this.startDate,
- endDate: this.endDate,
- pageNum: this.currentPage,
- pageSize: this.pageSize
- }).then((res) => {
- this.tableData = res.data.records
- })
- },
- onSearch() {
- getGamePersonList({
- gameTitle: this.gameTitle,
- nickName: this.nickName,
- phone: this.phone,
- startDate: this.startDate,
- endDate: this.endDate,
- pageSize: this.pageSize
- }).then((res) => {
- this.tableData = res.data.records
- this.gameTotal = res.data.total
- this.pageSize = res.data.size
- })
- },
- onReset() {
- this.gameTitle = undefined
- this.nickName = undefined
- this.phone = undefined
- this.daterange = undefined
- this.startDate = undefined
- this.endDate = undefined
- this.currentPage = 1
- this.pageSize = 10
- this.onSearch()
- },
- dateChange(val) {
- this.startDate = this.daterange[0]
- this.endDate = this.daterange[1]
- }
- }
- }
- </script>
- <style>
- </style>
|