<template>
  <div id="model-1">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index" @click.native="detail(item.id)">
          <el-col :span="15" class="name textOver">{{ item.name }} </el-col>
          <el-col :span="6" class="type textOver"> 专利有限性：{{ item.term }} </el-col>
          <el-col :span="3" class="date"> {{ item.success_date }} </el-col>
          <el-col :span="24" class="brief">
            {{ item.abstract }}
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'model-1',
  props: {
    list: { type: Array, default: () => [] },
  },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    detail(id) {
      this.$router.push({ path: './list', query: { index: this.index, id } });
    },
  },
  computed: {
    ...mapState(['user']),
    index() {
      return parseInt(this.$route.query.index) || 0;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .list {
    border-bottom: 1px dashed #ccc;
    padding: 12px 0;
    .name {
      font-size: 18px;
      padding: 0 0 5px 0;
    }
    .type {
      font-size: 16px;
      text-align: left;
      padding: 0 0 5px 0;
    }
    .date {
      font-size: 16px;
      text-align: right;
      padding: 0 0 5px 0;
    }
    .brief {
      font-size: 16px;
      overflow: hidden;
      text-overflow: ellipsis;
      -webkit-line-clamp: 2;
      word-break: break-all;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      height: 40px;
    }
  }
  .list:hover {
    cursor: pointer;
    .name {
      color: #409eff;
      font-weight: bold;
    }
  }
}
</style>
