<template>
  <div :class="inline ? 'inline' : ''" class="QdmInfo">
    <span :style="'width:' + colSpan + 'px;text-align:' + align + ';'"><i v-if="must">*</i>{{ name }}</span>
    <p :class="col">{{ value }}</p>
  </div>
</template>
<script>
export default {
  name: "QdmInfo",
  props: {
    name: {
      type: String,
      default: ''
    },
    value: {
      type: String,
      default: ''
    },
    col: {
      type: String,
      default: 'small'
    },
    colSpan: {
      type: Number,
      default: 60
    },
    align: {
    	type: String,
      default: 'right'
    },
    inline: {
      type: Boolean,
      default: false
    },
    must: {
      type: Boolean,
      default: false
    }
  }
}
</script>
<style lang="less">
.inline {
  float: left;
}
.QdmInfo {
  margin-right: 10px;
  height: 30px;
  margin-bottom: 8px;
  >span {
    display: block;
    height: 30px;
    float: left;
    line-height: 30px;
    padding-right: 8px;
    font-size: 12px;
    >i {
      color: #F5222D;
      margin-right: 5px;
      padding-left: 3px;
    }
  }
  >p {
    line-height: 30px;
    height: 30px;
    float: left;
    font-size: 12px;
    text-align: left;
    overflow: hidden;
	  white-space: nowrap;
	  text-overflow: ellipsis;
    &.large {
      width: 320px;
    }
    &.medium {
      width: 250px;
    }
    &.small {
      width: 180px;
    }
    &.mini {
      width: 100px;
    }
  }
}
</style>