<template>
  <div>
    <div class="con-title">{{ $t('pages.affairsHall.uploadReport.title') }}</div>
    <div class="con-box">
      <el-button type="text" @click="gobackReportActiveList">{{
        $t('pages.affairsHall.uploadReport.backText')
      }}</el-button>
      <div style="width: 100%; height: 0.2rem"></div>
      <table-list v-bind="tableOptions" ref="tableList"></table-list>
    </div>
  </div>
</template>

<script>
import TableList from '@/components/comTable/tableList'
import * as api from '../../api'
export default {
  props: {
    rid: { type: String, required: true }
  },
  components: { TableList },
  data() {
    return {
      tableOptions: {
        remote: {
          request: api.getAcitivityReportList,
          beforeRequest: this.tableListbeforeRequest
        },
        columns: [
          { prop: 'index', label: '序号' },
          { prop: 'report_name', label: '报告名称' },
          { prop: 'report_description', label: '报告摘要' },
          { prop: 'submit_time', label: '提交时间' },
          { prop: 'file_url', label: '附件下载' },
          {
            label: '操作',
            buttons: [
              {
                label: '编辑',
                onClick: row => {
                  this.$router.push({
                    path: `/app/offices/view-report/${row.form.id}`
                  })
                }
              },
              {
                label: '删除',
                onClick: row => {
                  this.$router.push({
                    path: `/app/offices/view-report/${row.form.id}`
                  })
                }
              }
            ]
          }
        ]
      }
    }
  }
}
</script>
