Timeline.vue 3.85 KB
Newer Older
1 2
<template>
  <ul class="timeline-wrapper">
zhangjianqian's avatar
zhangjianqian committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
    <li class="timeline-item" >
      <div class="timeline-box">
        <div class="out-circle">
          <div class="in-circle"></div>
        </div>
        <div class="long-line"></div>
      </div>
      <div class="timeline-content">
        <div class="timeline-date el-form-div">
          <div style="width: 180px">{{nowItem.createTime}}</div>
          <div >事件发布</div>
        </div>
        <div class="timeline-title">{{ nowItem.eventName}}</div>
        <div class="timeline-title">地址:{{ nowItem.address}}</div>
      </div>
    </li>
19 20 21 22 23 24 25 26
    <li class="timeline-item" v-for="t in timelineList" :key="t.id">
      <div class="timeline-box">
        <div class="out-circle">
          <div class="in-circle"></div>
        </div>
        <div class="long-line"></div>
      </div>
      <div class="timeline-content">
zhangjianqian's avatar
zhangjianqian committed
27 28 29 30 31
        <div class="timeline-date el-form-div">
          <div style="width: 180px">{{t.createTime}}</div>
          <div  v-if="t.eventType==2">预案指引</div>
          <div v-if="t.eventType==1">信息处置</div>
        </div>
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
        <div class="timeline-title">{{ t.management}}</div>
        <div class="timeline-desc">
            <span
              class="dbtn"
              @click="checkFile(t.managementEvent)"
              v-if="t.managementEvent != null && t.managementEvent!=''"
            >
              <i class="el-icon el-icon-view"></i>查看/下载
            </span>
            <span v-else>-</span>
        </div>
      </div>
    </li>
  </ul>

</template>

<script type="text/babel">
  import Vue from 'vue'
  export default Vue.component('Timeline',{
    name: "Timeline",
    props: {
      timelineList: {
        type: Array,
        default: () => {
          return []
        }
zhangjianqian's avatar
zhangjianqian committed
59 60
      },
      nowItem:{}
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
    },
    methods: {
      checkFile(url) {
        window.open(url,'_blank');
      },
    }
  })
</script>

<style scoped lang="scss">
  ul.timeline-wrapper {
    list-style: none;
    margin: 0;
    padding: 0;
  }
zhangjianqian's avatar
zhangjianqian committed
76 77 78 79 80 81
  .el-form-div{
    display:flex;
    flex-direction:row;
    justify-content:flex-start;
    width: 100%;
  }
82 83 84 85 86 87 88 89 90
  /* 时间线 */
  .timeline-item {
    position: relative;

    .timeline-box {
      text-align: center;
      position: absolute;

      .out-circle {
91 92
        width: 18px;
        height: 18px;
93 94 95 96 97 98 99 100
        background: rgba(14, 116, 218, 0.1);
        box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
        /*opacity: 0.1;*/
        border-radius: 50%;
        display: flex;
        align-items: center;

        .in-circle {
101 102
          width: 8px;
          height: 8px;
103 104 105 106 107 108 109 110
          margin: 0 auto;
          background: rgba(14, 116, 218, 1);
          border-radius: 50%;
          box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
        }
      }

      .long-line {
111
        width: 1px;
112
        height: 98px;
113
        background: #000000;
114 115 116 117 118 119 120 121 122 123
        box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
        opacity: 0.5;
        margin-left: 8px;
      }
    }

    .timeline-content {
      box-sizing: border-box;
      margin-left: 20px;
      height: 86px;
124
      padding: 6px 0 0 20px;
125 126 127 128
      text-align: left;
      margin-bottom: 30px;

      .timeline-title {
129
        font-size: 15px;
130 131
        word-break: break-all;
        margin-bottom: 16px;
132
        color: #000000;
133 134 135 136 137
        font-weight: 500;
        /*display: inline;*/
      }

      .timeline-date {
138
        font-size: 13px;
139
        color: #000000;
140 141 142 143 144
        font-weight: 500;
        margin-bottom: 16px;
      }
      .timeline-desc {
        font-size: 14px;
145
        color: #000000;
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
      }
    }

  }

  .dbtn {
    display: inline-block;
    line-height: normal;
    padding-left: 2px;
    padding-right: 2px;
    cursor: pointer;
    border-radius: 3px;
    border-style: solid;
    border-width: 0;
    color: rgb(48, 180, 107);
  }
  .timeline-item:last-of-type .timeline-content {
    margin-bottom: 0;
  }
</style>