DetailList.vue 4.61 KB
<template>
  <div class="list_container">
    <div class="item" v-for="(item,index) in list" :key="index" v-show="type==1">
      <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" v-show="type!=1">
      <div class="file-item" v-for="(item,index) in fileList" :key="index" @click="jumpPdfDetail(item)">
        <div class="file-title">
          <img :src="pdfIcon2">
          <span>{{item.title}}</span>
        </div>
        <div class="file-time">
          <div class="file-item-right">
            <img :src="timeUpdateIcon" alt="">
            <span>更新日期:{{item.time}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'DetailList',
  props: {
    type: {
      type: String,
    }
  },
  data() {
    return {
      pdfIcon: require('@/assets/icon/pdf_icon.png'),
      pdfIcon2: require('@/assets/icon/pdf.png'),
      timeUpdateIcon: require('@/assets/icon/time_update.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: '终稿' },
          ]
        }
      ],
      fileList: [
        {
          id: 1,
          title: '【初稿】无锡产业发展集团有限公司2020年三季度财务报表',
          time: '2021-4-12 '
        },
        {
          id: 2,
          title: '【初稿】无锡产业发展集团有限公司2020年三季度财务报表',
          time: '2021-4-13 '
        },
        {
          id: 3,
          title: '【初稿】无锡产业发展集团有限公司2020年三季度财务报表',
          time: '2021-4-14 '
        }
      ]
    }
  },
  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;
    }
  }
}
.file-item {
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0px 0px 6px 0px rgba(2, 15, 41, 0.06);
  .file-title {
    padding: 10px 15px 10px 0;
    margin-left: 15px;
    border-bottom: 1px solid #efefef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    img {
      width: 22px;
      height: 29px;
      margin-right: 10px;
    }
    span {
      font-size: 13px;
      color: #388de2;
      text-decoration: underline;
      flex: 1;
    }
  }
}
.file-time {
  padding: 10px 0;
  display: flex;
  justify-content: flex-end;
  .file-item-right {
    display: flex;
    align-items: center;
    img {
      width: 15px;
      height: 15px;
      margin-right: 7px;
    }
    span {
      font-size: 12px;
      color: #888d8d;
      margin-right: 15px;
    }
  }
}
</style>