<template>
  <a-card :bordered="false">
    <!-- table区域-begin -->
    <div>
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
        :pagination="false" :loading="loading">
        <span slot="url" slot-scope="text">
          <img :src="text+'?x-oss-process=video/snapshot,t_00000,m_fast'" style="width:200px" alt="">
        </span>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />

          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
  </a-card>
</template>

<script>
  import JTreeSelect from '@/components/jeecg/JTreeSelect'
  import {
    httpAction,
    getAction
  } from '@/api/manage'
  //   import {
  //     JeecgListMixin
  //   } from '@/mixins/JeecgListMixin'

  export default {
    name: 'ProjectList',
    // mixins: [JeecgListMixin],
    components: {
      JTreeSelect
    },
    props: {
      dataSource: {
        type: Array,
        default () {
          return []
        }
      },
      ipagination: {
        type: Object,
        default () {
          return {
            current: 1,
            pageSize: 10,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
              return range[0] + "-" + range[1] + " 共" + total + "条"
            },
            showQuickJumper: true,
            // showSizeChanger: true,
            total: 0
          }
        }
      },
      loading: {
        type: Boolean,
        default () {
          return false
        }
      }
    },
    data() {
      return {
        description: '视频素材列表页',
        // 表头
        columns: [{
            title: '项目名称',
            align: 'center',
            dataIndex: 'projectName'
          },
          {
            title: '素材名称',
            align: 'center',
            dataIndex: 'materialName'
          },
          {
            title: '素材',
            align: 'center',
            dataIndex: 'url',
            scopedSlots: {
              customRender: 'url'
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            scopedSlots: {
              customRender: 'action'
            }
          }
        ],
        url: {},
      }
    },
    computed: {
      importExcelUrl: function () {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    methods: {
      filterOption(input, option) {
        return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
      },
    },
    mounted() {
  
    },
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>