<template>
  <div class="div_content" @click="onClickDetail">
    <div class="div_title">
      <span class="span_title">{{tender.tenderProject}}</span>
    </div>
    <div class="div_content_key_value">
      <span class="span_key">投标时间：</span>
      <span class="span_value">{{tender.createTime}}</span>
    </div>
    <div class="div_content_key_value">
      <span class="span_key">投标结果：</span>
      <span :class="resultClasses">{{tender.tenderResult}}</span>
    </div>

  </div>
</template>

<script>
  export default {
    name: "providerTenderItem",
    data(){
      return{
        spanValue:"span_value",
        spanResultBlue:"span_result_blue",
        spanResultGreen:"span_result_green",
        spanResultRed:"span_result_red",
      }

    },
    computed:{
      resultClasses(){
        let classes = {};
        if (this.tender.tenderResult === '未知'){
          classes[this.spanValue] = true;
        }
        if (this.tender.tenderResult === '投标未中'){
          classes[this.spanResultRed] = true;
        }
        if (this.tender.tenderResult === '中标未签'){
          classes[this.spanResultGreen] = true;
        }
        if (this.tender.tenderResult === '中标已签'){
          classes[this.spanResultBlue] = true;
        }
        return classes;
      }
    },
    props:{
      tender:{
        type:Object,
      }
    },
    methods:{
      onClickDetail(){

      }
    }
  }
</script>

<style scoped>
  .div_content{
    display: flex;
    flex-direction: column;
    padding: 15px;
    margin: 0 15px 10px;
    background-color: white;
    border-radius: 5px;
  }
  .div_title{
    display: flex;
    flex-direction: row;
    flex-flow: nowrap;
    align-items: center;
  }
  .span_title{
    color: #333333;
    font-size: 16px;
    overflow: hidden;
    text-overflow:ellipsis;
    white-space: nowrap;
    flex: 1;
  }
  .div_content_key_value{
    width: 100%;
    display: flex;
    flex-direction: row;
    margin-top: 10px;
  }
  .span_key{
    color: #999999;
    font-size: 12px;
    width: 60px;
  }
  .span_value{
    color: #999999;
    font-size: 12px;
    margin-left: 5px;
  }
  .span_result_blue{
    color: #5998F0;
    font-size: 12px;
    margin-left: 5px;
  }
  .span_result_green{
    color: #47BCC8;
    font-size: 12px;
    margin-left: 5px;
  }
  .span_result_red{
    color: #EE4444;
    font-size: 12px;
    margin-left: 5px;
  }


</style>
