<template>
  <div class="list" v-if="list.length != 0">
    <div class="list-box" v-for="(item,index) in list" :key="index" @click="itemClick(item.sat_noticeid)">
      <div class="item-left">
        <el-image 
                :src="item.cover || require('@/assets/notify.png')" 
                lazy
                fit="scale-down"></el-image>
        <div class="text-panl">
          <div class="title">
            {{item.title}}
          </div>
          <div class="descript">
            {{item.summary}}
          </div>
          <div class="info">
            <span class="tag">{{item.classname}}</span>
            <span>{{item.createdate}}</span>
            <span>阅读量:<span>{{item.readcount}}</span></span>
            <span><span>附件数量：<span>{{item.readpersoncount}}</span></span></span>
          </div>
        </div>
      </div>
      <div class="item-right">
        <p :style="{'background':item.readstatus == '已读' ? '#FA8C16' : '#EEEEEE'}">{{item.readstatus}}</p>
      </div>
    </div>
  </div>
  <el-empty description="暂无数据" v-else></el-empty>
</template>

<script>
export default {
  name: 'list',
  data() {
    return {
    };
  },
  props: {
    list: {
      default() {
        return []
      }
    }
  },
  computed:{
  },
  watch:{
  },
  created() {

  },
  methods: {
    //通告iten单击事件
    itemClick(id) {
      this.$router.push({
        path: '/notice_detail',
        query: {
          sat_noticeid: id
        }
      })
    },
  },
};
</script>

<style scoped>
 .list {
  margin-top: 10px;
}
 .list-box {
  display: flex;
  justify-content: space-between;
  padding:  20px 0;
  border-bottom: 1px solid #DDDDDD;
  padding-right: 30px;
}
 .list-box:hover {
  cursor: pointer;
  background: #FAFAFA;
}

 .list-box:last-child {
  border-bottom: none;
}
 .list-box .item-left {
  display: flex;
}
 .list-box .item-left .el-image {
  width: 130px;
  height: 80px;
  margin-right: 20px;
  border-radius: 8px;
}
 .list-box .item-left .text-panl .title {
  width: 650px;
  font-size: 14px;
  color: #333333;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
 .list-box .item-left .text-panl .descript {
  width: 650px;
  font-size: 12px;
  color: #666666;
  margin-top: 9px;
}
 .list-box .item-left .text-panl .info {
  line-height: 22px;
  margin-top: 10px;
}
 .list-box .item-left .text-panl .info .tag {
  height: 22px;
  border: 1px solid #FA8C16;
  color: #FA8C16;
  margin-right: 10px;
  text-align: center;
  padding: 0 10px;
}
 .list-box .item-left .text-panl .info span {
  font-size: 12px;
  display: inline-block;
}
 .list-box .item-left .text-panl .info span:nth-child(2) {
  margin-right: 38px;
}
 .list-box .item-left .text-panl .info span:nth-child(3) {
  margin-right: 50px;
}

 .list-box .item-right {

}
 .list-box .item-right p {
  width: 60px;
  height: 32px;
  border-radius: 4px;
  text-align: center;
  line-height: 32px;
  font-size: 14px;
  color: #FFFFFF;
  cursor: pointer;
}
.el-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
}
</style>
