<template>
  <el-dialog
    title="查看优化建议"
    width="700px"
    :visible.sync="dialogVisible"
  >
  <el-table style="width: 100%" v-loading="listLoading" :key="tableKey" :data="list" row-key="id" stripe border fit
  highlight-current-row>
  <el-table-column label="序号" type="index" width="60" align="center" />
  <el-table-column label="建议内容" min-width="100" align="center" prop="remark" />
  <el-table-column label="操作人" min-width="100" align="center" prop="creator" />
  <el-table-column label="创建时间" min-width="100" align="center" prop="createTime" />
  </el-table>
  <div class="pages-black" style="overflow: hidden;">
    <!-- 分页 -->
    <swPage v-if="total > 0" key="2" :listQuery="listQuery" :total="total" pos="btmRight" @retPage="retPage" />
  </div>
  </el-dialog>
</template>

<script>
import { fetchSuggestionList } from "@/api/video";
import swPage from "@/views/common/swPage";
export default {
  name: "SuggestionTable",
  props: {
  },
  components: {
    swPage,
  },
  data() {
    return {
      dialogVisible: false,
      listLoading: false,
      tableKey: 0,
      list: [],
      total:0,
      listQuery: {
        currentPage: 1,
        pageSize: 10,
        videoId: '',
        operationType: 1
      },
      rows: {}
    };
  },
  methods: {
    show(row) {
      this.dialogVisible = true;
      this.rows = row;
      this.listQuery.videoId = row.id;
      this.getList()
    },
    getList() {
      this.listLoading = true;
      fetchSuggestionList(this.listQuery).then(res => {
        if (200 == res.code) {
          this.total = res.data.total;
          this.list = res.data.rows;
        }
        this.listLoading = false;
      });
    },
    retPage() {
      //分页
      this.getList();
    },
  }
};
</script>

<style scoped>
.el-select {
  width: 100%;
}
</style>
