<template>
  <div class="table-box">
    <el-table
      border
      stripe
      :data="list">
      <el-table-column
        prop="name"
        label="名称"
      ></el-table-column>
      <el-table-column
        label="启停标志"
      >
        <template slot-scope="props">
          <span>{{ props.row.is_valid | filterValid }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="出入"
      >
        <template slot-scope="props">
          <span>{{ props.row.is_in | filterInOut }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="创建时间"
      >
        <template slot-scope="props">
          <span>{{ props.row.createTime | formatTime }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  filters: {
    filterValid (n) {
      return n === 1 ? '启用' : '停用'
    },
    filterInOut (n) {
      return n === 1 ? '入口' : '出口'
    }
  }
}
</script>
