<template>
  <LabelBox
    :label="formItems.attrs?.label"
    :need-star="formItems.attrs?.needStar"
    :width="formItems.attrs?.width"
  >
    <el-date-picker
      class="datePicker"
      size="mini"
      type="month"
      :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-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>

