<template>
  <div :class="['filter-item', {'oneline': size=='oneline'}]">
    <div class="filter-item-label">{{label}}</div>
    <div :class="`filter-item-input filter-item-input---${size}`">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'search-item',
  props: {
    label: {
      type: String,
      default: '查询条件',
    },
    size: {
      type: String,
      default: 'normal',
    },
  },
};
</script>

<style lang="scss">
@import '../../assets/styles/variables.scss';

.filter-item {
  display: flex;
  line-height: 22px;
  margin-right: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  &.oneline {
    width: 100%;
  }
  .filter-item-label {
    margin-right: 6px;
    width: 60px;
    text-align: right;
  }
  .filter-item-input---big {
    width: 262px;
  }
  .filter-item-input---normal {
    width: 114px;
  }
  .filter-item-input---small {
    width: 150px;
  }
  .date-range-pick {
    .el-input__prefix {
      transform: translate(-16px);
    }
  }
}
@media screen and (min-width: $bigScreenWidth) {
  .filter-item {
    line-height: 40px;
    margin-right: 20px;
    margin-bottom: 20px;
    font-size: 16px;
    .filter-item-label {
      margin-right: 10px;
      width: 82px;
    }
    .filter-item-input---datePicker {
      width: 502px;
    }
    .filter-item-input---big {
      width: 324px;
    }
    .filter-item-input---normal {
      width: 200px;
    }
    .filter-item-input---small {
      width: 150px;
    }
    .date-range-pick {
      .el-input__prefix {
        transform: translate(-26px);
      }
    }
  }
}
</style>
