<template>
  <div>
    <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght">
      <template v-slot:customcol="scope">
        <p >{{scope.column.data[scope.column.columnname]}}</p>
      </template>
      <template v-slot:opreation="scope">
        <div>
          <slot name="del" :data="scope.data"></slot>
        </div>
      </template>
    </tableLayout>
  </div>
</template>

<script>
export default {
  name: "fileTable",
  props:["id"],
  data(){
    return {
      tableHieght:220,
      tablecols:[],
      list:[]
    }
  },
  mounted() {
    this.listData()
  },
  methods:{
    async listData(){
      const res = await this.$api.requested({
        "classname": "system.attachment.Attachment",
        "method": "queryFileLink",
        "content": {
          "ownertable": "plm_technicalinfo",
          "ownerid": this.id,
          "usetype":"default"//传空返回有所
        }
      })

      this.list = res.data
      console.log(this.list);
      
    }
  },
  created() {
    this.tablecols = this.tool.tabelCol(this.$route.name).fileTable.tablecols
  }
}
</script>

<style scoped>

</style>