<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>
      <waterfall :line-gap="200" :watch="tableData">
        <!-- each component is wrapped by a waterfall slot -->
        <waterfall-slot
          v-for="(item, index) in tableData"
          :key="index + 'cd'"
          :width="'100'"
          :height="'200'"
          :order="index"
        >
          <el-card :body-style="{ padding: '20px' }">
            <img :src="item.img" class="image">
            <div style="padding: 14px;">
              <span>{{ item.name }}</span>
              <div class="bottom clearfix">
                <time class="time">{{ item.info }}</time>
                <el-button type="text" class="button" @click="addDevice(item.id, item.name, item.info, item.img)">查看详情</el-button>
              </div>
            </div>
          </el-card>
        </waterfall-slot>
      </waterfall>
    </div>
  </div>
</template>

<script>
import waves from '@/directive/waves'; // 水波纹效果
// 瀑布流
import Waterfall from 'vue-waterfall/lib/waterfall';
import WaterfallSlot from 'vue-waterfall/lib/waterfall-slot';

export default {
  directives: { waves },
  components: {
    Waterfall,
    WaterfallSlot,
  },
  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=1608527314530&di=f10ab336902a2b09ee102f6c765afe75&imgtype=0&src=http%3A%2F%2Fgss0.baidu.com%2F94o3dSag_xI4khGko9WTAnF6hhy%2Fzhidao%2Fpic%2Fitem%2Ff11f3a292df5e0fea1aee17a5f6034a85edf7212.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,
      }, {
        name: '刘专家',
        info: '刘专家毕业于北京电影有先进的工作计划和工作经验对报警器这,对设备对接有足够的经验',
        img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3295650107,2085001310&fm=26&gp=0.jpg',
        id: 7,
      }, {
        name: '赵专家',
        info: '赵专家毕业于北京大学有足够的it方面的经验,对物联网,互联网有一定的经验',
        img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608527314530&di=f10ab336902a2b09ee102f6c765afe75&imgtype=0&src=http%3A%2F%2Fgss0.baidu.com%2F94o3dSag_xI4khGko9WTAnF6hhy%2Fzhidao%2Fpic%2Fitem%2Ff11f3a292df5e0fea1aee17a5f6034a85edf7212.jpg',
        id: 8,
      }, {
        name: '菅专家',
        info: '菅专家毕业于杭州科技学院有足够的it方面的经验,对物联网,互联网有一定的经验,对报警设备对设备线路有经验',
        img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=205530922,171182159&fm=26&gp=0.jpg',
        id: 9,
      }, {
        name: '冯专家',
        info: '冯专家毕业于杭州科技学院有足够的it方面的经验,对物联网,互联网有一定的经验,对报警设备对设备线路有经验',
        img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3329910816,3196132831&fm=26&gp=0.jpg',
        id: 10,
      }, {
        name: '好专家',
        info: '好专家毕业于杭州科技学院有足够的it方面的经验,对物联网,互联网有一定的经验,对报警设备对设备线路有经验',
        img: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2409559085,2443372796&fm=26&gp=0.jpg',
        id: 11,
      }],
    };
  },
  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>
