doum
68 分钟以前 eec6d612475e5080a9d3148d9c6ef20104a77b13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<template>
  <TableLayout :permissions="['business:comment:query']">
    <!-- 搜索表单 -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
     
      <el-form-item label="评论内容" prop="content">
        <el-input v-model="searchForm.content" placeholder="请输入评论内容" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="用户昵称" prop="nikeName">
        <el-input v-model="searchForm.nikeName" placeholder="请输入用户昵称" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="评论级别" prop="type">
        <!-- 类型 0一级评论 1回复 -->
        <el-select
          v-model="searchForm.type"
          placeholder="请选择优惠券类型"
        >
          <el-option key="0" :value="0" label="一级评论"></el-option>
          <el-option key="1" :value="1" label="评论回复"></el-option>
        </el-select>
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- 表格和分页 -->
    <template v-slot:table-wrap>
      <!-- <ul class="toolbar" v-permissions="['business:comment:delete']">
        <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:comment:delete']">删除</el-button></li>
      </ul> -->
      <el-table
        v-loading="isWorking.search"
        :data="tableData.list"
        stripe
        border
        @selection-change="handleSelectionChange"
      >
        <!-- <el-table-column type="selection" width="55"></el-table-column> -->
       
        <el-table-column prop="nikeName" label="用户昵称" align="center" min-width="100px"></el-table-column>
        <el-table-column prop="content" label="评论内容" align="center" min-width="100px"></el-table-column>
        <el-table-column label="评论级别" align="center" min-width="100px">
          <template slot-scope="{row}">
            {{ row.type==0 ? '一级评论' : '评论回复' }}
          </template>
        </el-table-column>
        <el-table-column prop="content" label="所属内容" align="center" min-width="100px"></el-table-column>
        <el-table-column label="内容类型" align="center" min-width="100px">
          <template slot-scope="{row}">
            {{ row.activityType==0 ? '商家活动'
              : row.activityType==1 ? '平台活动'
              : row.activityType==2 ? '探店' :'资讯'
            }}
          </template>
        </el-table-column>
        <el-table-column prop="createDate" label="评论时间" align="center" min-width="100px"></el-table-column>
        <el-table-column prop="memberId" label="是否展示" align="center" min-width="100px">
          <template slot-scope="{row}">
            <el-switch
              v-model="row.status"
              active-color="#13ce66"
              inactive-color="#999"
              :active-value="0"
              :inactive-value="1"
              @change="statusChange(row)"
            ></el-switch>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="activityId" label="对象编码(关联activity表)" min-width="100px"></el-table-column>
        <el-table-column prop="content" label="内容" min-width="100px"></el-table-column>
        <el-table-column prop="anonymous" label="是否匿名 0是 1否" min-width="100px"></el-table-column>
        <el-table-column prop="replyId" label="回复记录编码(关联comment表)" min-width="100px"></el-table-column>
        <el-table-column prop="replyMemberId" label="回复对象用户编码(关联member表" min-width="100px"></el-table-column>
        <el-table-column prop="commentId" label="一级评论编码(关联comment表)" min-width="100px"></el-table-column>
        <el-table-column prop="commentMemberId" label="一级评论用户编码(关联member表" min-width="100px"></el-table-column>
        <el-table-column prop="type" label="类型 0一级评论 1回复" min-width="100px"></el-table-column>
        <el-table-column prop="status" label="状态 0显示 1隐藏" min-width="100px"></el-table-column>
        <el-table-column prop="statusUser" label="操作人编码(关联system_user表)" min-width="100px"></el-table-column>
        <el-table-column prop="statusDate" label="操作时间" min-width="100px"></el-table-column>
        <el-table-column prop="statusInfo" label="操作备注" min-width="100px"></el-table-column>
        <el-table-column prop="recIntegral" label="邀请奖励咖豆" min-width="100px"></el-table-column>
        <el-table-column
          v-if="containPermissions(['business:comment:update', 'business:comment:delete'])"
          label="操作"
          min-width="120"
          fixed="right"
        >
          <template slot-scope="{row}">
            <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:comment:delete']">删除</el-button>
          </template>
        </el-table-column> -->
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      >
      </pagination>
    </template>
  </TableLayout>
</template>
 
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import { updateById } from '@/api/business/comment'
export default {
  name: 'Comment',
  extends: BaseTable,
  components: { TableLayout, Pagination },
  data () {
    return {
      // 搜索
      searchForm: {
        id: '',
        creator: '',
        createDate: '',
        editor: '',
        editDate: '',
        isdeleted: '',
        remark: '',
        memberId: '',
        activityId: '',
        content: '',
        anonymous: '',
        replyId: '',
        replyMemberId: '',
        commentId: '',
        commentMemberId: '',
        type: '',
        status: '',
        statusUser: '',
        statusDate: '',
        statusInfo: '',
        recIntegral: ''
      }
    }
  },
  created () {
    this.config({
      module: '发现模块评论管理信息表(资讯、探店)',
      api: '/business/comment',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    statusChange(row) {
      updateById(row)
        .then(res => {
          this.$message.success('操作成功')
        })
        .catch(e => {
          this.$message.error(e)
        })
        .finally(() => {
          this.search()
        })
    }
  },
}
</script>