<template>
  <div id="model-0">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="btn">
          <slot></slot>
        </el-col>
        <el-col :span="24" class="info">
          <el-col :span="24" class="title">
            {{ data.title }}
          </el-col>
          <el-col :span="24" class="other">
            <el-col :span="12" class="text">
              信息来源：<span>{{ data.origin }}</span>
            </el-col>
            <el-col :span="12" class="text">
              发布时间：<span>{{ data.release_time }}</span>
            </el-col>
          </el-col>
          <el-col :span="24" class="content">
            <p v-html="data.content"></p>
          </el-col>
          <el-col :span="24" class="image" v-if="data.image">
            <el-carousel height="300px" :interval="2000">
              <el-carousel-item v-for="(tag, index) in data.image" :key="index">
                <el-image :src="tag.url"></el-image>
              </el-carousel-item>
            </el-carousel>
          </el-col>
          <el-col :span="24" class="fileUrl" v-if="data.fileUrl && data.fileUrl.length > 0">
            <p>附件：</p>
            <el-link :href="data.fileUrl[0].url">{{ data.fileUrl[0].name }}</el-link>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'model-0',
  props: {
    data: { type: Object },
  },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {},
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .btn {
    text-align: right;
    margin: 0 0 10px 0;
  }
  .info {
    .title {
      font-size: 18px;
      text-align: center;
      font-weight: bold;
      margin: 0 0 15px 0;
    }
    .other {
      margin: 0 0 15px 0;
      .text {
        font-size: 14px;
        color: #666;
        text-align: right;
        padding: 0 10px;
        span {
          color: #000;
        }
      }
      .text:nth-child(2) {
        text-align: left;
      }
    }
    .content {
      font-size: 16px;
      text-indent: 2rem;
      margin: 0 0 15px 0;
    }
    .image {
      text-align: center;
      padding: 0 26%;
      .el-image {
        width: 100%;
        height: 100%;
      }
    }
  }
}
</style>
