<template>
  <div id="model-1">
    <el-row class="list" @click.native="toDetail">
      <el-col :span="24" class="title">
        {{ data.title }}
      </el-col>
      <el-col :span="24" class="other">
        <p>
          更新时间：<span>{{ data.publish_time || '暂无' }}</span>
        </p>
        <p>
          信息来源：<span>{{ data.origin || '暂无' }}</span>
        </p>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'model-1',
  props: { data: { type: Object, default: () => {} } },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    toDetail() {
      this.$router.push({ path: this.detailRouter, query: { id: this.data._id } });
    },
  },
  computed: {
    ...mapState(['user', 'menuParams']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
    detailRouter() {
      const key = this.$route.meta.key;
      return `/${key}/detail`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped>
.list {
  padding: 10px 5px;
  background: #fff;
  margin: 0 0 5px 0;
  border-radius: 5px;
  .title {
    font-size: 15px;
    font-weight: bold;
    margin: 0 0 5px 0;
  }
  .other {
    p {
      padding: 0 0 5px 0;
      color: #666;
      font-size: 14px;
      span {
        color: #000;
      }
    }
  }
}
</style>
