<!--右侧选中项目的列表-->
<template>
  <div>
    <el-table
      ref="moveTable"
      stripe
      border
      size="small"
      highlight-current-row
      :data="getPage"
      style="width: 100%"
      :height="tableHeight"
      @select-all="_selectAll"
      @selection-change="_selectRowChange"
      @row-click="_clickRow"
    >
      <el-table-column
        type="selection"
        width="55">
      </el-table-column>
      <el-table-column
        v-for="item in pageColumns"
        :key="item.id"
        show-overflow-tooltip
        :prop="item.key"
        :label="item.title"
        :min-width="item.width"
      >
        <template slot-scope="scope">
          <span v-if="item.key==='scened'">{{ scope.row[item.key]?'':scope.row[item.key]===0?'否':'是' }}</span>
          <span v-else>{{ scope.row[item.key] }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: {
    formId: null,
    getPage: null,
    pageColumns: null
  },
  data() {
    return {
      // tableHeight: document.documentElement.clientHeight - 230
    }
  },
  computed: {
    tableHeight: function() {
      return this.$tableHeight('tableDetail')
    }
  },
  methods: {
    // 选中行的同时选中checkbox
    _clickRow(row) {
      this.$refs.moveTable.toggleRowSelection(row)
    },
    // 多选
    _selectRowChange(data) {
      this.$emit('on-result-change', 'click', data)
    },
    _selectAll: function(data) {
      this._selectRowChange(data)
    }
  }
}
</script>
