<template>
  <div>
    <el-table :data="commonData" header-row-class-name="custom-table-header" @expand-change="expandChange">
      <el-table-column type="expand">
        <template slot-scope="props">
          <Table :data="showData[props.row.index]" :column="column" @option="handleOption" />
        </template>
      </el-table-column>
      <el-table-column v-for="column in columnList" :label="column.label" :prop="column.prop"
        show-overflow-tooltip></el-table-column>
    </el-table>
  </div>
</template>
  
<script>
import Table from "./table";

export default {
  props: {
    commonData: Object,
    column: {//显示栏位管理数组
      type: Array,
      default: () => {
        return [
          {
            "key": "name",
            "name": "事件名称",
            "type": "list",
            "order": 0,
            "hidden": true
          },
          {
            "key": "eventNumber",
            "name": "相关报告数量",
            "type": "list",
            "order": 0,
            "hidden": true
          },
          {
            "key": "projectNumber",
            "name": "相关专题库数量",
            "type": "list",
            "order": 0,
            "hidden": true
          },
          {
            "key": "projectNumber1",
            "name": "事件场景",
            "type": "list",
            "order": 0,
            "hidden": true
          },
          {
            "key": "projectNumber2",
            "name": "事件时间",
            "type": "list",
            "order": 0,
            "hidden": true
          },
          {
            "key": "projectNumber3",
            "name": "描述",
            "type": "list",
            "order": 0,
            "hidden": true
          },
          {
            "key": "projectNumber4",
            "name": "创建人",
            "type": "list",
            "order": 0,
            "hidden": true
          },
          {
            "key": "time",
            "name": "创建时间",
            "type": "list",
            "order": 0,
            "hidden": true
          },
        ]
      }
    }
  },
  mixins: [],
  components: {
    Table
  },
  data() {
    return {
      columnList: [],
      tableData: [],
      showData: []
    }
  },
  watch: {
  },
  mounted() {
  },
  methods: {
    //操作列事件
    handleOption(data) {
      this.$emit('option', data)
    },
    //打开展开行获取数据并保存起来
    expandChange() {
      
    }
  }
}
</script>
  