DetailList.vue 2.78 KB
<template>
  <div class="list_container">
    <!-- {{type}} -->
    <div class="item" v-for="(item,index) in list" :key="index">
      <h2>{{item.title}}</h2>
      <div class="item_child">
        <div class="child" v-for="(childItem,childIndex) in item.arr" :key="childIndex" @click="jumpPdfDetail(childItem)">
          <div class="child-title"><span>{{childItem.title}}</span><img :src="pdfIcon" alt=""></div>
          <div class="time">{{childItem.time}}</div>
        </div>
      </div>
    </div>
    <div class="item-other">
      1
    </div>
  </div>
</template>
<script>
export default {
  name: 'DetailList',
  props: {
    type: {
      type: String,
      default: '1'
    }
  },
  data() {
    return {
      pdfIcon: require('@/assets/icon/pdf_icon.png'),
      list: [
        {
          title: '无锡产业发展集团有限公司2020年三季度财务报表',
          arr: [
            { time: '2021.4.12', title: '初稿' }
          ]
        },
        {
          title: '无锡产业发展集团有限公司2020年三季度财务报表',
          arr: [
            { time: '2021.4.12', title: '初稿' },
            { time: '2021.4.13', title: '上会搞' },
          ]
        },
        {
          title: '无锡产业发展集团有限公司2020年三季度财务报表',
          arr: [
            { time: '2021.4.12', title: '初稿' },
            { time: '2021.4.13', title: '上会搞' },
            { time: '2021.4.13', title: '终稿' },
          ]
        }
      ]
    }
  },
  watch: {
    type() {
      //   console.log(111)
      return this.type
    }
  },
  methods: {
    jumpPdfDetail(item) {
      this.$router.push({
        name: 'PdfView',
        query: {
          item
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
.item {
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0px 0px 6px 0px rgba(2, 15, 41, 0.06);
  margin-bottom: 10px;
  h2 {
    padding: 10px 15px;
    border-bottom: 1px solid #efefef;
    font-size: 14px;
    color: #222;
  }
  .item_child {
    display: flex;
    padding: 15px 0;
    .child {
      width: 33%;
      text-align: center;
      position: relative;
      &:after {
        content: "";
        position: absolute;
        top: 0px;
        right: 0;
        border-right: 1px solid #efefef;
        height: 40px;
      }
      &:last-child {
        &:after {
          border-right: 0;
        }
      }
      .child-title {
        display: flex;
        align-items: center;
        justify-content: center;
        span {
          text-decoration: underline;
          font-size: 14px;
          color: #388de2;
          margin-right: 2px;
        }
      }
      .time {
        font-size: 11px;
        color: #666;
      }
    }
    img {
      width: 19px;
      height: 14px;
    }
  }
}
</style>