|
@@ -0,0 +1,149 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!--<div class="filter-container">
|
|
|
+ <el-input v-model="listQuery.mobile" placeholder="手机号" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
|
|
|
+ <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
|
|
|
+ 搜索
|
|
|
+ </el-button>
|
|
|
+ </div>-->
|
|
|
+ <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
|
|
|
+ <el-table-column align="center" label="ID" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.id }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="180px" align="center" label="用户id">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.user_id }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column class-name="status-col" align="center" label="用户名称">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.user_name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column class-name="status-col" label="内容">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.content }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column class-name="status-col" label="发送时间" width="180px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.send_time }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!--<el-table-column class-name="status-col" label="主播昵称" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.anchor_name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ <!--<el-table-column class-name="status-col" label="直播类型" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.type | typeFilter }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ <!-- <el-table-column align="center" label="Actions" width="300" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-row>
|
|
|
+ <router-link :to="'/live/edit/'+scope.row.id">
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-edit" style="margin-right: 10px;">
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
+ </router-link>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { fetchList } from '@/api/chat'
|
|
|
+import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
|
|
+import waves from '@/directive/waves'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'ChatList',
|
|
|
+ components: { Pagination },
|
|
|
+ directives: { waves },
|
|
|
+ filters: {
|
|
|
+ typeFilter(type) {
|
|
|
+ const statusMap = {
|
|
|
+ 1: '推流',
|
|
|
+ 0: '手机直播'
|
|
|
+ }
|
|
|
+ return statusMap[type]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ list: null,
|
|
|
+ total: 0,
|
|
|
+ listLoading: true,
|
|
|
+ listQuery: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ roomId: 0
|
|
|
+ },
|
|
|
+ temp: {
|
|
|
+ id: undefined,
|
|
|
+ mark: '',
|
|
|
+ status: ''
|
|
|
+ },
|
|
|
+ dialogFormVisible: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ const id = this.$route.params && this.$route.params.id
|
|
|
+ if (!isNaN(id)) {
|
|
|
+ this.listQuery['roomId'] = id
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ this.listLoading = true
|
|
|
+ fetchList(this.listQuery).then(response => {
|
|
|
+ this.list = response.data.list
|
|
|
+ this.total = response.data.count
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleFilter() {
|
|
|
+ this.listLoading = true
|
|
|
+ fetchList(this.listQuery).then(response => {
|
|
|
+ this.list = response.data.list
|
|
|
+ this.total = response.data.count
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async handleUpdate({ $index, row }) {
|
|
|
+ this.temp = Object.assign({}, row) // copy obj
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['dataForm'].clearValidate()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.edit-input {
|
|
|
+ padding-right: 100px;
|
|
|
+}
|
|
|
+.cancel-btn {
|
|
|
+ position: absolute;
|
|
|
+ right: 15px;
|
|
|
+ top: 10px;
|
|
|
+}
|
|
|
+.filter-container{
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+.filter-item {
|
|
|
+ margin-right: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|