<template>
  <div class="list" v-if="list.length != 0">
    <div class="list-item" @click="itemClick(item.sat_submiteditmodelid,item.ishistory)" v-for="(item,index) in list"
      :key="index">
      <div class="header1">
        <div class="handle" :class="item.ishistory == 0 ? 'action' : 'no-action'">
          {{item.ishistory == 0 ? '进行中' : '已结束'}}
        </div>
        <p class="title">{{item.title}}</p>
      </div>
      <div class="decript">{{item.notes}}</div>
      <div class="time">有效期:{{item.begdate}}~{{item.enddate}}</div>
      <div class="footer">
        <p class="submit">已提报:{{item.submitcount}}</p>
        <div class="status" :class="item.isRead == 0 ? 'no-raed' : 'read'">{{item.isRead == 0 ? '未读' : '已读'}}</div>
      </div>
    </div>
  </div>
  <el-empty description="暂无数据" v-else></el-empty>
</template>

<script>
export default {
  name: 'list',
  data () {
    return {
    };
  },
  props: {
    list: {
      type: Array
    },
    type: {
      default () {
        return ''
      }
    }
  },
  computed: {
  },
  watch: {
  },
  mounted () {
  },
  methods: {
    itemClick (id, history) {
      window.sessionStorage.setItem('currentPath', this.$route.path)
      window.sessionStorage.setItem('history', history)
      this.$router.push({
        path: '/submiteditmag_detail',
        query: {
          id: id,
          type: this.type
        }
      })
    }
  },
};
</script>

<style scoped>
* {
  box-sizing: border-box;
}
.list {
  display: flex;
  flex-wrap: wrap;
  margin-top: 16px;
}
.list .list-item {
  width: 390px;
  height: 140px;
  background: #f8f8f8;
  border-radius: 4px 4px 4px 4px;
  margin: 0 16px 16px 0;
  padding: 16px;
  cursor: pointer;
  transition: border 0.1s ease-in-out;
}
.list .list-item:hover {
  box-shadow: 0px 3px 8px 1px rgba(0, 0, 0, 0.15);
}
.list .list-item .header1 {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
}
.list .list-item .header1 .handle {
  font-size: 12px;
  font-weight: 400;
  margin-right: 10px;
  width: 52px;
  height: 24px;
  border-radius: 2px 2px 2px 2px;
  border: 1px solid #cccccc;
  text-align: center;
  line-height: 22px;
}
.list .list-item .header1 .action {
  color: #fa8c16;
  border: 1px solid #fa8c16;
}
.list .list-item .header1 .no-action {
  color: #666666;
  border: 1px solid #cccccc;
}
.list .list-item .header1 .title {
  font-size: 14px;
  font-weight: bold;
  color: #333333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list .list-item .decript {
  font-size: 12px;
  font-weight: bold;
  color: #333333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 15px;
}
.list .list-item .time {
  font-size: 12px;
  font-weight: 400;
  color: #999999;
  margin-bottom: 10px;
}
.list .list-item .footer {
  display: flex;
  justify-content: space-between;
}
.list .list-item .footer .submit {
  font-size: 12px;
  font-weight: 400;
  color: #999999;
}
.list .list-item .footer .status {
  width: 36px;
  height: 24px;
  border-radius: 4px 4px 4px 4px;
  font-size: 12px;
  font-weight: normal;
  text-align: center;
  line-height: 22px;
}
.list .list-item .footer .read {
  color: #ff3b30;
  background: #ffedec;
}
.list .list-item .footer .no-read {
  color: #999999;
  background: #eeeeee;
}
/deep/.el-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
</style>
