<template>
  <li class="audio-item">
    <div class="audio-item_top clearfix">
      <img class="fl" src="../../../assets/img/icon_audio.gif" alt="" srcset="">
      <div class="fl">
        <h5 class="ellipsis-100">{{audioData.titleName || '未命名语音'}}</h5>
        <p class="gray fz12 ellipsis-100">创建于:{{audioData.createTimeStr}}</p>
      </div>
    </div>
    <div class="audio-item_bottom">
      <i class="el-icon-edit" @click="edit"></i>
      <i class="el-icon-delete" @click="del"></i>
    </div>
  </li>
</template>

<script>
export default {
  props: {
    audioData: {
      type: Object,
      default: function () {
        return {

        }
      }
    }
  },
  methods: {
    edit(){
      this.$emit('edit',this.audioData.voiceId);
    },
    del() {
      this.$emit('del',{voiceId:this.audioData.voiceId,voiceMediaId:this.audioData.voiceMediaId});
    }
  }
}
</script>
<style lang="scss" scoped>
@import '../../../assets/style/base/var.scss';
.audio-item{
  border: 1px solid #e4e7ed;
  width: 290px;
  margin: 10px;
  max-height: 111px;
  overflow: hidden;
  &:hover{
    border: 1px solid #409eff;
  }
  &_top{
    padding:10px;
    &>div{
      padding-left: 15px;
      line-height: 20px;
    }
  }
  &_bottom {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 30px;
    background: $gray-color;
    border-top: 1px solid $border-color;
    cursor: pointer;
    i{
      font-size: 16px;
      &:hover{
        color: #409eff;
      }
    }
  }
}
</style>
