<template>
  <div class="l-flex__auto l-flex--col has-padding">
    <c-table
      :curr="options"
      @pagination="getList"
    >
      <el-table-column
        prop="name"
        label="节目名称"
        align="center"
        show-overflow-tooltip
      />
      <el-table-column
        prop="resolutionRatio"
        label="分辨率"
        align="center"
        show-overflow-tooltip
      />
      <el-table-column
        prop="createBy"
        label="申请人"
        align="center"
        show-overflow-tooltip
      />
      <el-table-column
        prop="createTime"
        label="创建时间"
        align="center"
        show-overflow-tooltip
      />
      <el-table-column
        label="操作"
        align="center"
        width="180"
      >
        <template v-slot="scope">
          <div
            class="c-table__btn u-pointer"
            @click.stop="toView(scope.row)"
          >
            预览
          </div>
          <div
            class="c-table__btn u-pointer"
            @click.stop="toResolve(scope.row)"
          >
            通过
          </div>
          <div
            class="c-table__btn u-pointer"
            @click.stop="toReject(scope.row)"
          >
            驳回
          </div>
        </template>
      </el-table-column>
    </c-table>
  </div>
</template>

<script>
import { getPrograms } from '@/api/program'
import mixin from './mixin'

export default {
  name: 'ReviewProgram',
  mixins: [mixin],
  methods: {
    _getList: getPrograms,
    toView ({ id }) {
      const route = this.$router.resolve({
        name: 'view',
        params: { id }
      })
      window.open(route.href, '_blank')
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
