<template>
  <vm-image-list :data="dataImageList" title="道具列表"  :total="total" @delete-ok="deletefn" class="vm-margin" @getList="getActorList"
    @updateList="getActorList(1, '')"></vm-image-list>
</template>

<script>
  import VmImageList from './modules/vm-image-list'
  import {
    propList
  } from '@/api/actor'
  export default {
    name: 'ImageList',
    components: {
      VmImageList
    },
    mounted() {
      this.$nextTick(() => {
        this.getActorList(1)
      })
    },
    methods: {
      deletefn: function (data) {
        for (let i = 0; i < this.dataImageList.length; i++) {
          if (this.dataImageList[i].id === data.id) {
            this.dataImageList.splice(i, 1)
          }
        }
      },
      getActorList(page, name) {
        this.dataImageList = []
        propList({
          pageNo: page,
          pageSize: 8,
          name: name
        }).then(res => {
          if (res.code == 0) {
            this.dataImageList = res.result.records
            this.total = res.result.total
          }
        })
      }
    },
    data: function () {
      return {
        dataImageList: [

        ],
        total: null
      }
    }
  }
</script>