<template>
  <div style="height: calc(100vh - 300px)">
    <el-table
        :data="tableData"
        row-key="id"
        border
        height="100%"
        size="mini"
        default-expand-all
        :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
        <el-table-column
            prop="name"
            align="left"
            header-align="center"
            label="指标名称">
          <template slot-scope="scope">
            <span v-if="scope.row.style">{{scope.row.name}}</span>
            <span v-else style="font-weight: bold;">{{scope.row.name}}</span>
          </template>
        </el-table-column>
        <el-table-column
            prop="unit"
            label="计量单位"
            width="120">
        </el-table-column>
        <el-table-column
            prop="code"
            label="代码"
            width="120">
        </el-table-column>
        <el-table-column
            prop="quantity"
            label="数量"
            width="200">
            <template slot-scope="scope">
              <el-input size="mini" v-model.trim="scope.row.quantity" :disabled="!scope.row.editable" />
            </template>
        </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    props: {
      tableData: {
        type: Array,
        default: () => []
      }
    },
    data(){
      return {

      }
    },
  }
</script>