<template>
  <div class="file-list">
    <div class="header1">
      <p class="title">附件列表</p>
      <div>
        <slot name="upload"></slot>
      </div>
    </div>
    <el-table :data="attinfos" border style="width: 100%" :header-cell-style="{ background: '#EEEEEE' }">
      <el-table-column prop="document" label="文件名称" width="500">
        <template slot-scope="scope">
          <div class="editor-handle">
            <span>{{ scope.row.document.substr(0, scope.row.document.indexOf('.')) }}</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="createdate" label="上传时间" width="250">
      </el-table-column>
      <el-table-column prop="contentlength" label="文件大小">
        <template slot-scope="scope">
          <span>{{ (scope.row.contentlength / 1024 / 1024).toFixed(2) }}M</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="150">
        <template slot-scope="scope">
          <div class="handle">
            <slot name="download" :data="scope.row"></slot>
            <slot name="delete" :data="scope.row"></slot>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'FileList',
  data() {
    return {
      tableData: [],
      attinfos: [],
      isShow: false,
      text: ''
    };
  },
  computed: {
  },
  watch: {
  },
  filters: {

  },
  created() {
  },
  methods: {
    inputFocus() {
      this.isShow = false
      this.$emit('titleUpdata', this.text)
    },
    randerData(list) {
      this.attinfos = list;
    },
  },
};
</script>

<style scoped>
.file-list {
  padding: 16px 16px;
  background: #ffffff;
  margin-top: 10px;
}

.file-list .title {
  font-size: 14px;
  font-weight: bold;
  color: #333333;
  margin-bottom: 30px;
}

.file-list .header1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-list .header1 .el-button {
  width: 84px;
  height: 36px;
}

.editor-handle {
  position: relative;
}

.editor-handle .span {}

.editor-handle img {}

.editor-handle .el-input {
  position: absolute;
  left: 0;
  top: 0;
}
</style>
