<template>
  <div class="app-container">
    <div class="filter-container">
      <el-form ref="query" style="display: inline-block;">
        <el-input placeholder="案例名称" clearable style="width: 200px;" class="filter-item" name="userskk" />
        <el-input placeholder="类型" clearable style="width: 200px;" class="filter-item" name="userskk" />
        <el-button v-waves class="filter-item" type="primary" icon="el-icon-search">
          {{ $t('table.search') }}
        </el-button>
        <el-button v-waves class="filter-item" type="primary" icon="el-icon-plus">
          {{ $t('table.add') }}
        </el-button>
      </el-form>
      <el-button v-waves class="filter-item" type="primary" icon="el-icon-download">
        {{ $t('table.export') }}
      </el-button>
      <el-button v-waves class="filter-item" type="primary" icon="el-icon-upload">
        导入
      </el-button>
    </div>
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column fixed prop="date" label="日期" width="150"></el-table-column>
      <el-table-column prop="title" label="案例名称" width="200"></el-table-column>
      <el-table-column prop="type" label="案例类型" width="120"></el-table-column>
      <el-table-column prop="body" label="案例内容"></el-table-column>
      <el-table-column fixed="right" label="操作" width="150">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">查看</el-button>
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
          <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import waves from '@/directive/waves'; // 水波纹效果
export default {
  directives: { waves },
  data() {
    return {
      tableData: [{
        date: '2016-05-02',
        title: '基于无线技术气体报警空气系统的设计方案',
        type: '一级案例',
        body: 'GPRS/3G/4G无线通讯技术，WiFi技术等遍布人们的生活和生产活动 工业气体报警探测器系统无线化已成为工业安全生产中的发展...',
      }, {
        date: '2016-05-02',
        title: '防止有毒有害气体中毒十个必须知道的内容',
        type: '一级案例',
        body: '关于毒气的危害本公司的专家总结出一下几点。下面就由本公司的专家为您讲解下赌气的危害。',
      }, {
        date: '2016-05-02',
        title: '居民燃气报警及控制系统解决方案',
        type: '一级案例',
        body: '它能有效地避免因燃气泄漏而引起的爆炸、火灾、中毒等恶性事故 已经在世界上大部分国家或地区广泛应用。',
      }],
    };
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    },
    handleClick(row) {
      console.log(row);
    },
  },
};
</script>

<style>
</style>
