<template>
  <LabelBox
    :label="formItems.attrs?.label"
    :need-star="formItems.attrs?.needStar"
    :width="formItems.attrs?.width"
  >
    <el-time-picker
      size="mini"
      :value="value"
      :placeholder="formItems.attrs?.placeholder || '选择时间'"
      v-bind="formItems.attrs"
      style="width:100%"
      v-on="formItems.events"
      @input="handleInput"
    />
  </LabelBox>
</template>

<script>
import LabelBox from '../labelBox/index.vue';

export default {
  components: {
    LabelBox,
  },
  props: {
    formItems: {
      type: Object,
      default: () => {},
    },
    value: {
      type: String,
      default: '',
    },
  },
  methods: {
    handleInput(val) {
      this.$emit('input', val);
      this.$emit('outOperation', val);
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep.el-range-editor--mini .el-range-separator {
  line-height: 16px;
}
::v-deep.el-range-editor--mini .el-range__icon {
  line-height: 16px;
}
::v-deep.el-range-editor.el-input__inner {
  height: 24px;
  line-height: 24px;
}

::v-deep.el-date-editor--daterange.el-input__inner, .eui-theme-default .el-date-editor--timerange.el-input, .eui-theme-default .el-date-editor--timerange.el-input__inner {
    width: 100%;
}

::v-deep.el-input .el-input__icon {
  height: 24px;
  line-height: 25px;
  margin-left: -6px;
}

::v-deep.el-input .el-input__inner {
  height: 24px;
  line-height: 24px;
}

::v-deep.el-input--prefix .el-input__inner{
  padding-left: 19px;
}

</style>

