<template>
  <div >
    <div class="content">
      <dataTable :table-data="tableData" :columns="columns" :page-obj="pageObj" :breads="breads" :table-top="60">
        <el-table-column slot="describe" label="分类描述" align="center" fixed="right" width="300">
          <template slot-scope="scope">
            <el-popover
              :content="scope.row.describe"
              placement="top-start"
              title="分类描述"
              width="300"
              trigger="hover">
              <div slot="reference">{{ scope.row.describe }}</div>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column slot="operate" label="操作" align="center" fixed="right" width="100">
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="examine(scope.row)">审核</el-button>
            <el-button v-if="scope.$index<3" type="text" size="small" @click="examine(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </dataTable>
      <div class="absolute">
        <el-button type="primary" @click="add">添加分类</el-button> 
      </div>
    </div>
  </div>
</template>

<script>
import dataTable from '@components/dataTable.vue'
export default {
  name: 'release',
  components: {
    dataTable
  },
  data() {
    return {
      checklist: [],
      breads: ['信息公告管理 ', '分类管理'],
      tableData: [{
        type: '新闻资讯',
        data: '2017-10-01 15：00',
        describe: '一段描述'
      },
      {
        type: '平台动态',
        data: '2017-10-01 15：00',
        describe: '一段描述'
      },
      {
        type: '法律法规',
        data: '2017-10-01 15：00',
        describe: '一段描述'
      },
      {
        type: '关于我们',
        data: '2017-10-01 15：00',
        describe: '一段描述'
      }
      ],
      columns: [
      
        {
          label: '分类名称',
          prop: 'type'
        },
        {
          slot: 'describe'
        },
        {
          label: '创建时间',
          prop: 'data',
          sortable: true
        },
        {
          slot: 'operate'
        }
      ], // 操作列
     
      pageObj: {
        size: 10,
        total: 1,
        currentPage: 1,
        sizes: [100, 200, 300],
        func: (currentPage) => {
          this.pageTurning(currentPage)
        }
      }
    }
  },
  methods: {
    add() {
      this.$router.push({
        path: `/admin/information/release/add`
      })
    }
  }
}
</script>

<style scoped>
	.absolute{
		position: absolute;
		top:67px;
		left:50px
	}
</style>
