<template>
    <div>
      <el-table :data-read-url="getData" :page-size="10" ref="imagePlayerTable" tooltip-effect="dark" @current-change="rowChangeHandle" :highlight-current-row="true" style="width: 100%">
        <el-table-column  prop="ID" label="ID"></el-table-column>
        <el-table-column label="封面图" width="180" align="center">
          <template slot-scope="scope">
            <img :src="scope.row.logoFile" onerror="this.src='assets/images/picture404-'+((row.ID||row.$index) % 4)+'.png';" width="24" height="24" />
          </template>
        </el-table-column>
        <el-table-column  prop="name" label="名称"></el-table-column>
       <el-table-column prop="code" label="别名">
        </el-table-column>
        <el-table-column prop="displayCount" label="最多图片数">
        </el-table-column>
      </el-table>
   </div>
</template>
<script>
export default {
  data() {
    return {
      imagePlayer: null
    }
  },
  methods: {
    getData() {
      return [ '/ui/pageweaver/resource/imageplayers', {
        params: {
          status: 'published',
          searchContent: ''
        }
      }]
    },
    rowChangeHandle(currentRow, oldRow) {
      this.imagePlayer = currentRow
      window.eventHub.$emit('imagePlayerPicked', currentRow)
    }
  }
}
</script>
<style scoped>

</style>
