<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-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>
    <div>
      <el-row>
        <el-col v-for="(o, index) in tableData" :key="index + 1" :span="5" :offset="index > 0 ? 2 : 0">
          <el-card :body-style="{ padding: '0px' }">
            <img :src="o.img" class="image">
            <div style="padding: 14px;">
              <span>{{ o.name }}</span>
              <div class="bottom clearfix">
                <time class="time">{{ o.info }}</time>
                <el-button type="text" class="button" @click="addDevice(o.id, o.name, o.info, o.img)">查看详情</el-button>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import waves from '@/directive/waves'; // 水波纹效果
export default {
  directives: { waves },
  data() {
    return {
      currentDate: new Date(),
      tableData: [{
        name: '李庄家',
        info: '李庄家毕业于石家庄工程学院有先进的工作计划和工作经验对报警器这方面有一定的了解',
        img: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1689867663,2720378664&fm=26&gp=0.jpg',
        id: 1,
      }, {
        name: '刘专家',
        info: '刘专家毕业于北京电影有先进的工作计划和工作经验对报警器这,对设备对接有足够的经验',
        img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3295650107,2085001310&fm=26&gp=0.jpg',
        id: 2,
      }, {
        name: '赵专家',
        info: '赵专家毕业于北京大学有足够的it方面的经验,对物联网,互联网有一定的经验',
        img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608445510168&di=1a33e116c5169fd5010f866d12f77ada&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn12%2F435%2Fw640h595%2F20180506%2F6105-hacuuvt9423634.jpg',
        id: 3,
      }, {
        name: '菅专家',
        info: '菅专家毕业于杭州科技学院有足够的it方面的经验,对物联网,互联网有一定的经验,对报警设备对设备线路有经验',
        img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=205530922,171182159&fm=26&gp=0.jpg',
        id: 4,
      }, {
        name: '冯专家',
        info: '冯专家毕业于杭州科技学院有足够的it方面的经验,对物联网,互联网有一定的经验,对报警设备对设备线路有经验',
        img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3329910816,3196132831&fm=26&gp=0.jpg',
        id: 5,
      }, {
        name: '好专家',
        info: '好专家毕业于杭州科技学院有足够的it方面的经验,对物联网,互联网有一定的经验,对报警设备对设备线路有经验',
        img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2409559085,2443372796&fm=26&gp=0.jpg',
        id: 6,
      }],
    };
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    },
    // 专家详情 o.id, o.name, o.info, o.img
    addDevice(id, name, info, img) {
      console.log(id);
      this.$router.push({ path: '/meetemergency/infozhuanjia',
        query: { id: id, name: name, info: info, img: img },
      });
    },
  },
};
</script>

<style>
  .time {
      font-size: 13px;
      color: #999;
    }
  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }
  .button {
    padding: 0;
    float: right;
  }
  .image {
    width: 100%;
    display: block;
  }
  .clearfix:before,
  .clearfix:after {
      display: table;
      content: "";
  }
  .clearfix:after {
      clear: both
  }
</style>
