<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="案例id" 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="name" label="案例名称" width="120"></el-table-column>
      <el-table-column prop="province" label="案例类型" width="120"></el-table-column>
      <el-table-column prop="city" label="案例是否执行" width="120"></el-table-column>
      <el-table-column prop="address" label="案例执行地址" width="300"></el-table-column>
      <el-table-column prop="zip" label="案例内容" width="120"></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" 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',
        name: '一级应急案例',
        province: '一级案例',
        city: '案例执行',
        address: '上海市普陀区金沙江路 1518 弄',
        zip: '石家庄第三期案例',
      }, {
        date: '2016-05-04',
        name: '二级应急案例',
        province: '二级应急案例',
        city: '案例取消',
        address: '上海市普陀区金沙江路 1517 弄',
        zip: '石家庄第三期案例',
      }, {
        date: '2016-05-01',
        name: '三级级应急案例',
        province: '三级级应急案例',
        city: '案例执行',
        address: '上海市普陀区金沙江路 1519 弄',
        zip: '石家庄第三期案例',
      }, {
        date: '2016-05-03',
        name: '四级级级应急案例',
        province: '四级级级应急案例',
        city: '案例取消',
        address: '上海市普陀区金沙江路 1516 弄',
        zip: '石家庄第三期案例',
      }],
    };
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    },
    handleClick(row) {
      console.log(row);
    },
  },
};
</script>

<style>
</style>
