<!--  -->
<template>
  <div class="rt-activity-progress-wrapp">
    <div class="activity-progress-list">
      <div class="activity-progress-item" v-for="item in list" :key="item.id">
        <div class="progress-item-left">
          <rt-icon :name="item.icon || 'rt-xrm-dial'" :size="16"></rt-icon>
        </div>
        <div class="progress-item-right" @click="click(item.id)">
          <div class="progress-item-header">
            <span class="progress-item-title">{{ item.title }}</span>
            <span class="progress-item-time">{{ item.time | moment('MM-DD HH:mm')}}</span>
          </div>
          <div class="progress-item-content">
            <p class="progress-item-desc">{{ item.desc }}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'rtActivityProgress',
  props: {
    list: {
      type: Array,
      default() {
        return [];
      }
    },
    link: String
  },
  methods: {
    click(id) {
      this.$router.push({ name: this.link, params: { id } });
    }
  }
};
</script>
<style lang='less'>
.rt-activity-progress-wrapp {
  padding: 10px;
  .activity-progress-list {
    position: relative;
    padding: 10px 0;
    .activity-progress-item {
      position: relative;
      display: flex;
      margin-bottom: 25px;
      &::before {
        content: '';
        position: absolute;
        height: 50%;
        border-left: 1px solid #e1e5ec;
        top: 0;
        z-index: -1;
        left: 7px;
      }
      &::after {
        content: '';
        position: absolute;
        height: calc(~"50% + 25px");
        border-left: 1px solid #e1e5ec;
        bottom: -25px;
        z-index: -1;
        left: 7px;
      }
      &:first-child::before,
      &:last-child::after {
        display: none;
      }
      .progress-item-left {
        display: flex;
        align-items: center;
        padding-right: 12px;
      }
      .progress-item-right {
        flex: 1;
        background: #fff;
        border-radius: 5px;
        padding: 10px;
        .progress-item-header {
          display: flex;
          align-items: center;
          padding: 5px 0;
          span.progress-item-title {
            font-size: 15px;
            color: #222220;
            font-weight: 600;
          }
          span.progress-item-time {
            margin-left: auto;
            color: #888;
            font-size: 12px;
          }
        }
        p.progress-item-desc {
          word-break: break-all;
          color: #888;
          font-size: 13px;
          line-height: 19px;
        }
      }
    }
  }
}
</style>